diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 289798d88dc5..f0f6de215ed4 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -2089,4 +2089,4 @@ } } } -} +} \ No newline at end of file diff --git a/eng/emitter-package.json b/eng/emitter-package.json index b33b0d4269d7..69da1a0f13e3 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -24,4 +24,4 @@ "@azure-tools/typespec-liftr-base": "0.13.0", "@azure-tools/openai-typespec": "1.23.0" } -} +} \ 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 22ae9928800a..009c9404ae1a 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -1,5 +1,48 @@ # Release History +## 2.5.0 (Unreleased) + +### Features Added + +* Added stable Agent-to-Agent (A2A) tools `A2ATool` and `A2AToolboxTool`, with the new `A2AProtocolVersion` enum for selecting protocol version `1.0`. +* Method `.beta.agents.begin_create_optimization_job` now returns a custom LRO poller named `AgentOptimizationLROPoller`. Its `details` property exposes the created job ID as `job_id`. +* Method `.beta.datasets.begin_create_generation_job` now returns a custom LRO poller named `DatasetGenerationLROPoller`. Its `details` property exposes the created job ID as `job_id`. +* Method `.beta.evaluators.begin_create_generation_job` now returns a custom LRO poller named `EvaluatorGenerationLROPoller`. Its `details` property exposes the created job ID as `job_id`. +* Added the optional read-only `state_source` property to `AgentDetails` and the new `AgentStateSource` enum. + +### Breaking Changes + +All breaking changes are associated with beta features. + +* Renamed class `TaskGenerationDataGenerationJobOptions` to `SimulationSeedDataGenerationJobOptions`. The corresponding `DataGenerationJobType.TASK_GENERATION` enum member was renamed to `DataGenerationJobType.SIMULATION_SEED`, and its wire value changed from `task_generation` to `simulation_seed`. +* Renamed enum `OptimizationDatasetInputType` to `AgentOptimizationDatasetInputType`. +* Renamed class `OptimizationAgentIdentifier` to `OptimizedAgentIdentifier`. +* Renamed class `OptimizationCandidate` to `AgentOptimizationCandidate`. +* Renamed class `OptimizationDatasetCriterion` to `AgentOptimizationDatasetCriterion`. +* Renamed class `OptimizationDatasetInput` to `AgentOptimizationDatasetInput`. +* Renamed class `OptimizationDatasetItem` to `AgentOptimizationDatasetItem`. +* Renamed class `OptimizationEvaluatorRef` to `AgentOptimizationEvaluatorRef`. +* Renamed class `OptimizationInlineDatasetInput` to `AgentOptimizationInlineDatasetInput`. +* Renamed class `OptimizationJob` to `AgentOptimizationJob`. +* Renamed class `OptimizationJobInputs` to `AgentOptimizationJobInputs`. +* Renamed class `OptimizationJobListItem` to `AgentOptimizationJobListItem`. +* Renamed class `OptimizationJobProgress` to `AgentOptimizationJobProgress`. +* Renamed class `OptimizationJobResult` to `AgentOptimizationJobResult`. +* Renamed class `OptimizationOptions` to `AgentOptimizationOptions`. +* Renamed class `OptimizationReferenceDatasetInput` to `AgentOptimizationReferenceDatasetInput`. + +### Sample updates + +* Added `sample_dataset_generation_job_simpleqna_for_finetuning_async.py` under `samples/datasets/`, demonstrating asynchronous generation of a SimpleQnA dataset for fine-tuning. +* Added `sample_dataset_generation_job_simpleqna_for_finetuning_with_app_polling.py` under `samples/datasets/`, demonstrating application-managed polling for a SimpleQnA fine-tuning data generation job. +* Added logging samples under `samples/logs/`: + * `sample_log_all.py` demonstrating combined logging for Azure SDK and `.get_openai_client()` operations. + * `sample_log_from_openai_client.py` demonstrating logging for an OpenAI client created from `.get_openai_client()`. + * `sample_log_from_sdk.py` demonstrating logging for Azure AI Projects SDK client operations. + * `sample_log_to_console.py` demonstrating console logging configuration. + * `sample_log_with_logging_disabled.py` demonstrating redacted logging behavior when `logging_enable` is not enabled. +* Renamed optimization polling samples `sample_optimization_job_basic_polling.py` and `sample_optimization_job_basic_polling_async.py` to `sample_optimization_job_advanced_app_polling.py` and `sample_optimization_job_advanced_app_polling_async.py`. + ## 2.4.0 (2026-07-24) ### Features Added diff --git a/sdk/ai/azure-ai-projects/PostEmitter.ps1 b/sdk/ai/azure-ai-projects/PostEmitter.ps1 index c5ae7d169221..4a7f6f2e519e 100644 --- a/sdk/ai/azure-ai-projects/PostEmitter.ps1 +++ b/sdk/ai/azure-ai-projects/PostEmitter.ps1 @@ -86,81 +86,6 @@ foreach ($f in $files) { Set-Content $f $c -NoNewline } -# A block of code in the implementation of "list_memories", in both sync -# and async _operations.py files, needs to be moved up. It's emitted in the wrong place, -# in the inline function named "prepare_request". Instead it should be moved up into the -# main body of the "list_memories" method, right after the line `error_map.update(kwargs.pop("error_map", {}) or {})`. -# If you don't do this, the PR pipeline will show failures in Pyright (`error: "body" is unbound (reportUnboundVariable)`) -# and some tests will fail. This is the block of code that needs to move up: -# if body is _Unset: -# if scope is _Unset: -# raise TypeError("missing required argument: scope") -# body = {"scope": scope} -# body = {k: v for k, v in body.items() if v is not None} -# The block inside prepare_request has 12-space indentation; after moving to the main function body it needs 8-space indentation. -# Strategy: Find the last list_memories method, then do a targeted string replacement that moves the block right after error_map.update. -$oldPattern = @" - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - def prepare_request(_continuation_token=None): - if body is _Unset: - if scope is _Unset: - raise TypeError("missing required argument: scope") - body = {"scope": scope} - body = {k: v for k, v in body.items() if v is not None} - - _request = build_beta_memory_stores_list_memories_request( -"@ -$newPattern = @" - error_map.update(kwargs.pop("error_map", {}) or {}) - if body is _Unset: - if scope is _Unset: - raise TypeError("missing required argument: scope") - body = {"scope": scope} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - def prepare_request(_continuation_token=None): - _request = build_beta_memory_stores_list_memories_request( -"@ -$files = 'azure\ai\projects\operations\_operations.py', 'azure\ai\projects\aio\operations\_operations.py' -foreach ($f in $files) { - $c = Get-Content $f -Raw - # Find all occurrences of "def list_memories(" and get the index of the last one - $methodMatches = [regex]::Matches($c, 'def list_memories\(') - if ($methodMatches.Count -eq 0) { continue } - $lastMethodStart = $methodMatches[$methodMatches.Count - 1].Index - - # Find the pattern to replace - first occurrence after the last list_memories method - $patternEscaped = [regex]::Escape($oldPattern) - $patternMatches = [regex]::Matches($c, $patternEscaped) - $matchToReplace = $null - foreach ($m in $patternMatches) { - if ($m.Index -gt $lastMethodStart) { - $matchToReplace = $m - break - } - } - if ($matchToReplace -eq $null) { continue } - - # Replace only that specific occurrence - $c = $c.Substring(0, $matchToReplace.Index) + $newPattern + $c.Substring($matchToReplace.Index + $matchToReplace.Length) - - Set-Content $f $c -NoNewline -} - - # Finishing by running 'black' tool to format code. pip install black black --config ../../../eng/black-pyproject.toml . diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index a683fb81cd13..3b89774c0ec7 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -405,7 +405,7 @@ namespace azure.ai.projects.aio.operations ) -> SessionFileWriteResult: ... - class azure.ai.projects.aio.operations.BetaAgentsOperations: + class azure.ai.projects.aio.operations.BetaAgentsOperations(BetaAgentsOperationsGenerated): def __init__( self, @@ -416,12 +416,12 @@ namespace azure.ai.projects.aio.operations @overload async def begin_create_optimization_job( self, - job: OptimizationJob, + job: AgentOptimizationJob, *, content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> AsyncLROPoller[OptimizationJobResult]: ... + ) -> AsyncAgentOptimizationLROPoller: ... @overload async def begin_create_optimization_job( @@ -431,7 +431,7 @@ namespace azure.ai.projects.aio.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> AsyncLROPoller[OptimizationJobResult]: ... + ) -> AsyncAgentOptimizationLROPoller: ... @overload async def begin_create_optimization_job( @@ -441,14 +441,14 @@ namespace azure.ai.projects.aio.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> AsyncLROPoller[OptimizationJobResult]: ... + ) -> AsyncAgentOptimizationLROPoller: ... @distributed_trace_async async def cancel_optimization_job( self, job_id: str, **kwargs: Any - ) -> OptimizationJob: ... + ) -> AgentOptimizationJob: ... @distributed_trace_async async def delete_optimization_job( @@ -462,7 +462,7 @@ namespace azure.ai.projects.aio.operations self, job_id: str, **kwargs: Any - ) -> OptimizationJob: ... + ) -> AgentOptimizationJob: ... @distributed_trace def list_optimization_jobs( @@ -474,10 +474,10 @@ namespace azure.ai.projects.aio.operations order: Optional[Union[str, PageOrder]] = ..., status: Optional[Union[str, JobStatus]] = ..., **kwargs: Any - ) -> AsyncItemPaged[OptimizationJobListItem]: ... + ) -> AsyncItemPaged[AgentOptimizationJobListItem]: ... - class azure.ai.projects.aio.operations.BetaDatasetsOperations: + class azure.ai.projects.aio.operations.BetaDatasetsOperations(BetaDatasetsOperationsGenerated): def __init__( self, @@ -493,7 +493,7 @@ namespace azure.ai.projects.aio.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> AsyncLROPoller[DataGenerationJobResult]: ... + ) -> AsyncDatasetGenerationLROPoller: ... @overload async def begin_create_generation_job( @@ -503,7 +503,7 @@ namespace azure.ai.projects.aio.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> AsyncLROPoller[DataGenerationJobResult]: ... + ) -> AsyncDatasetGenerationLROPoller: ... @overload async def begin_create_generation_job( @@ -513,7 +513,7 @@ namespace azure.ai.projects.aio.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> AsyncLROPoller[DataGenerationJobResult]: ... + ) -> AsyncDatasetGenerationLROPoller: ... @distributed_trace_async async def cancel_generation_job( @@ -639,7 +639,7 @@ namespace azure.ai.projects.aio.operations ) -> EvaluationTaxonomy: ... - class azure.ai.projects.aio.operations.BetaEvaluatorsOperations: + class azure.ai.projects.aio.operations.BetaEvaluatorsOperations(BetaEvaluatorsOperationsGenerated): def __init__( self, @@ -655,7 +655,7 @@ namespace azure.ai.projects.aio.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> AsyncLROPoller[EvaluatorVersion]: ... + ) -> AsyncEvaluatorGenerationLROPoller: ... @overload async def begin_create_generation_job( @@ -665,7 +665,7 @@ namespace azure.ai.projects.aio.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> AsyncLROPoller[EvaluatorVersion]: ... + ) -> AsyncEvaluatorGenerationLROPoller: ... @overload async def begin_create_generation_job( @@ -675,7 +675,7 @@ namespace azure.ai.projects.aio.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> AsyncLROPoller[EvaluatorVersion]: ... + ) -> AsyncEvaluatorGenerationLROPoller: ... @distributed_trace_async async def cancel_generation_job( @@ -2547,6 +2547,7 @@ namespace azure.ai.projects.models name: str object: Literal[AgentObjectType.AGENT] state: Union[str, AgentState] + state_source: Optional[Union[str, AgentStateSource]] versions: AgentObjectVersions @overload @@ -2684,6 +2685,271 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.AgentOptimizationCandidate(_Model): + avg_score: float + avg_tokens: float + candidate_id: Optional[str] + eval_id: Optional[str] + eval_run_id: Optional[str] + mutations: Optional[dict[str, Any]] + name: str + promotion: Optional[PromotionInfo] + + @overload + def __init__( + self, + *, + avg_score: float, + avg_tokens: float, + candidate_id: Optional[str] = ..., + eval_id: Optional[str] = ..., + eval_run_id: Optional[str] = ..., + mutations: Optional[dict[str, Any]] = ..., + name: str, + promotion: Optional[PromotionInfo] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationDatasetCriterion(_Model): + instruction: str + name: str + + @overload + def __init__( + self, + *, + instruction: str, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationDatasetInput(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INLINE = "inline" + REFERENCE = "reference" + + + class azure.ai.projects.models.AgentOptimizationDatasetItem(_Model): + criteria: Optional[list[AgentOptimizationDatasetCriterion]] + desired_num_turns: Optional[int] + ground_truth: Optional[str] + query: Optional[str] + + @overload + def __init__( + self, + *, + criteria: Optional[list[AgentOptimizationDatasetCriterion]] = ..., + desired_num_turns: Optional[int] = ..., + ground_truth: Optional[str] = ..., + query: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationEvaluatorRef(_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.AgentOptimizationInlineDatasetInput(AgentOptimizationDatasetInput, discriminator='inline'): + dataset_items: list[AgentOptimizationDatasetItem] + type: Literal[AgentOptimizationDatasetInputType.INLINE] + + @overload + def __init__( + self, + *, + dataset_items: list[AgentOptimizationDatasetItem] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationJob(_Model): + created_at: datetime + error: Optional[ApiError] + id: str + inputs: Optional[AgentOptimizationJobInputs] + progress: Optional[AgentOptimizationJobProgress] + result: Optional[AgentOptimizationJobResult] + status: Union[str, JobStatus] + updated_at: datetime + warnings: Optional[list[str]] + + @overload + def __init__( + self, + *, + inputs: Optional[AgentOptimizationJobInputs] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationJobInputs(_Model): + agent: OptimizedAgentIdentifier + evaluators: list[AgentOptimizationEvaluatorRef] + options: Optional[AgentOptimizationOptions] + train_dataset: AgentOptimizationDatasetInput + validation_dataset: Optional[AgentOptimizationDatasetInput] + + @overload + def __init__( + self, + *, + agent: OptimizedAgentIdentifier, + evaluators: list[AgentOptimizationEvaluatorRef], + options: Optional[AgentOptimizationOptions] = ..., + train_dataset: AgentOptimizationDatasetInput, + validation_dataset: Optional[AgentOptimizationDatasetInput] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationJobListItem(_Model): + agent: Optional[OptimizedAgentIdentifier] + created_at: datetime + error: Optional[ApiError] + id: str + progress: Optional[AgentOptimizationJobProgress] + status: Union[str, JobStatus] + updated_at: datetime + + + class azure.ai.projects.models.AgentOptimizationJobProgress(_Model): + best_score: float + candidates_completed: int + elapsed_seconds: float + + @overload + def __init__( + self, + *, + best_score: float, + candidates_completed: int, + elapsed_seconds: float + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationJobResult(_Model): + baseline: Optional[str] + best: Optional[str] + candidates: Optional[list[AgentOptimizationCandidate]] + + @overload + def __init__( + self, + *, + baseline: Optional[str] = ..., + best: Optional[str] = ..., + candidates: Optional[list[AgentOptimizationCandidate]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationLROPoller(LROPoller[AgentOptimizationJobResult]): + property details: Mapping[str, Any] # Read-only + + def __init__( + self, + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any + ) -> None: ... + + @classmethod + def from_continuation_token( + cls, + polling_method: PollingMethod[AgentOptimizationJobResult], + continuation_token: str, + **kwargs: Any + ) -> AgentOptimizationLROPoller: ... + + + class azure.ai.projects.models.AgentOptimizationOptions(_Model): + eval_model: Optional[str] + evaluation_level: Optional[Union[str, EvaluationLevel]] + max_candidates: Optional[int] + max_stalls: Optional[int] + optimization_config: Optional[dict[str, Any]] + optimization_model: Optional[str] + + @overload + def __init__( + self, + *, + eval_model: Optional[str] = ..., + evaluation_level: Optional[Union[str, EvaluationLevel]] = ..., + max_candidates: Optional[int] = ..., + max_stalls: Optional[int] = ..., + optimization_config: Optional[dict[str, Any]] = ..., + optimization_model: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationReferenceDatasetInput(AgentOptimizationDatasetInput, discriminator='reference'): + name: str + type: Literal[AgentOptimizationDatasetInputType.REFERENCE] + 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.AgentSessionResource(_Model): agent_session_id: str created_at: datetime @@ -2721,6 +2987,11 @@ namespace azure.ai.projects.models ENABLED = "enabled" + class azure.ai.projects.models.AgentStateSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT_BLUEPRINT = "agent_blueprint" + AGENT_INSTANCE_IDENTITY = "agent_instance_identity" + + class azure.ai.projects.models.AgentTaxonomyInput(EvaluationTaxonomyInput, discriminator='agent'): risk_categories: list[Union[str, RiskCategory]] target: EvaluationTarget @@ -2890,6 +3161,66 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.AsyncAgentOptimizationLROPoller(AsyncLROPoller[AgentOptimizationJobResult]): + property details: Mapping[str, Any] # Read-only + + def __init__( + self, + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any + ) -> None: ... + + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[AgentOptimizationJobResult], + continuation_token: str, + **kwargs: Any + ) -> AsyncAgentOptimizationLROPoller: ... + + + class azure.ai.projects.models.AsyncDatasetGenerationLROPoller(AsyncLROPoller[DataGenerationJobResult]): + property details: Mapping[str, Any] # Read-only + + def __init__( + self, + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any + ) -> None: ... + + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[DataGenerationJobResult], + continuation_token: str, + **kwargs: Any + ) -> AsyncDatasetGenerationLROPoller: ... + + + class azure.ai.projects.models.AsyncEvaluatorGenerationLROPoller(AsyncLROPoller[EvaluatorVersion]): + property details: Mapping[str, Any] # Read-only + + def __init__( + self, + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any + ) -> None: ... + + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[EvaluatorVersion], + continuation_token: str, + **kwargs: Any + ) -> AsyncEvaluatorGenerationLROPoller: ... + + class azure.ai.projects.models.AsyncUpdateMemoriesLROPoller(AsyncLROPoller[MemoryStoreUpdateCompletedResult]): property superseded_by: Optional[str] # Read-only property update_id: str # Read-only @@ -4310,6 +4641,26 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.DatasetGenerationLROPoller(LROPoller[DataGenerationJobResult]): + property details: Mapping[str, Any] # Read-only + + def __init__( + self, + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any + ) -> None: ... + + @classmethod + def from_continuation_token( + cls, + polling_method: PollingMethod[DataGenerationJobResult], + continuation_token: str, + **kwargs: Any + ) -> DatasetGenerationLROPoller: ... + + class azure.ai.projects.models.DatasetReference(_Model): name: str version: str @@ -5058,6 +5409,26 @@ namespace azure.ai.projects.models TRACES = "traces" + class azure.ai.projects.models.EvaluatorGenerationLROPoller(LROPoller[EvaluatorVersion]): + property details: Mapping[str, Any] # Read-only + + def __init__( + self, + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any + ) -> None: ... + + @classmethod + def from_continuation_token( + cls, + polling_method: PollingMethod[EvaluatorVersion], + continuation_token: str, + **kwargs: Any + ) -> EvaluatorGenerationLROPoller: ... + + class azure.ai.projects.models.EvaluatorGenerationTokenUsage(_Model): input_tokens: int output_tokens: int @@ -7001,7 +7372,7 @@ namespace azure.ai.projects.models SUCCEEDED = "Succeeded" - class azure.ai.projects.models.OptimizationAgentIdentifier(_Model): + class azure.ai.projects.models.OptimizedAgentIdentifier(_Model): agent_name: str agent_version: Optional[str] @@ -7017,251 +7388,6 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OptimizationCandidate(_Model): - avg_score: float - avg_tokens: float - candidate_id: Optional[str] - eval_id: Optional[str] - eval_run_id: Optional[str] - mutations: Optional[dict[str, Any]] - name: str - promotion: Optional[PromotionInfo] - - @overload - def __init__( - self, - *, - avg_score: float, - avg_tokens: float, - candidate_id: Optional[str] = ..., - eval_id: Optional[str] = ..., - eval_run_id: Optional[str] = ..., - mutations: Optional[dict[str, Any]] = ..., - name: str, - promotion: Optional[PromotionInfo] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.OptimizationDatasetCriterion(_Model): - instruction: str - name: str - - @overload - def __init__( - self, - *, - instruction: str, - name: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.OptimizationDatasetInput(_Model): - type: str - - @overload - def __init__( - self, - *, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.OptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INLINE = "inline" - REFERENCE = "reference" - - - class azure.ai.projects.models.OptimizationDatasetItem(_Model): - criteria: Optional[list[OptimizationDatasetCriterion]] - desired_num_turns: Optional[int] - ground_truth: Optional[str] - query: Optional[str] - - @overload - def __init__( - self, - *, - criteria: Optional[list[OptimizationDatasetCriterion]] = ..., - desired_num_turns: Optional[int] = ..., - ground_truth: Optional[str] = ..., - query: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.OptimizationEvaluatorRef(_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.OptimizationInlineDatasetInput(OptimizationDatasetInput, discriminator='inline'): - dataset_items: list[OptimizationDatasetItem] - type: Literal[OptimizationDatasetInputType.INLINE] - - @overload - def __init__( - self, - *, - dataset_items: list[OptimizationDatasetItem] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.OptimizationJob(_Model): - created_at: datetime - error: Optional[ApiError] - id: str - inputs: Optional[OptimizationJobInputs] - progress: Optional[OptimizationJobProgress] - result: Optional[OptimizationJobResult] - status: Union[str, JobStatus] - updated_at: datetime - warnings: Optional[list[str]] - - @overload - def __init__( - self, - *, - inputs: Optional[OptimizationJobInputs] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.OptimizationJobInputs(_Model): - agent: OptimizationAgentIdentifier - evaluators: list[OptimizationEvaluatorRef] - options: Optional[OptimizationOptions] - train_dataset: OptimizationDatasetInput - validation_dataset: Optional[OptimizationDatasetInput] - - @overload - def __init__( - self, - *, - agent: OptimizationAgentIdentifier, - evaluators: list[OptimizationEvaluatorRef], - options: Optional[OptimizationOptions] = ..., - train_dataset: OptimizationDatasetInput, - validation_dataset: Optional[OptimizationDatasetInput] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.OptimizationJobListItem(_Model): - agent: Optional[OptimizationAgentIdentifier] - created_at: datetime - error: Optional[ApiError] - id: str - progress: Optional[OptimizationJobProgress] - status: Union[str, JobStatus] - updated_at: datetime - - - class azure.ai.projects.models.OptimizationJobProgress(_Model): - best_score: float - candidates_completed: int - elapsed_seconds: float - - @overload - def __init__( - self, - *, - best_score: float, - candidates_completed: int, - elapsed_seconds: float - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.OptimizationJobResult(_Model): - baseline: Optional[str] - best: Optional[str] - candidates: Optional[list[OptimizationCandidate]] - - @overload - def __init__( - self, - *, - baseline: Optional[str] = ..., - best: Optional[str] = ..., - candidates: Optional[list[OptimizationCandidate]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.OptimizationOptions(_Model): - eval_model: Optional[str] - evaluation_level: Optional[Union[str, EvaluationLevel]] - max_candidates: Optional[int] - max_stalls: Optional[int] - optimization_config: Optional[dict[str, Any]] - optimization_model: Optional[str] - - @overload - def __init__( - self, - *, - eval_model: Optional[str] = ..., - evaluation_level: Optional[Union[str, EvaluationLevel]] = ..., - max_candidates: Optional[int] = ..., - max_stalls: Optional[int] = ..., - optimization_config: Optional[dict[str, Any]] = ..., - optimization_model: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.OptimizationReferenceDatasetInput(OptimizationDatasetInput, discriminator='reference'): - name: str - type: Literal[OptimizationDatasetInputType.REFERENCE] - 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.OtlpTelemetryEndpoint(TelemetryEndpoint, discriminator='OTLP'): auth: TelemetryEndpointAuth data: Union[list[str, TelemetryDataKind]] @@ -9796,7 +9922,7 @@ namespace azure.ai.projects.operations ) -> SessionFileWriteResult: ... - class azure.ai.projects.operations.BetaAgentsOperations: + class azure.ai.projects.operations.BetaAgentsOperations(BetaAgentsOperationsGenerated): def __init__( self, @@ -9807,12 +9933,12 @@ namespace azure.ai.projects.operations @overload def begin_create_optimization_job( self, - job: OptimizationJob, + job: AgentOptimizationJob, *, content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> LROPoller[OptimizationJobResult]: ... + ) -> AgentOptimizationLROPoller: ... @overload def begin_create_optimization_job( @@ -9822,7 +9948,7 @@ namespace azure.ai.projects.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> LROPoller[OptimizationJobResult]: ... + ) -> AgentOptimizationLROPoller: ... @overload def begin_create_optimization_job( @@ -9832,14 +9958,14 @@ namespace azure.ai.projects.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> LROPoller[OptimizationJobResult]: ... + ) -> AgentOptimizationLROPoller: ... @distributed_trace def cancel_optimization_job( self, job_id: str, **kwargs: Any - ) -> OptimizationJob: ... + ) -> AgentOptimizationJob: ... @distributed_trace def delete_optimization_job( @@ -9853,7 +9979,7 @@ namespace azure.ai.projects.operations self, job_id: str, **kwargs: Any - ) -> OptimizationJob: ... + ) -> AgentOptimizationJob: ... @distributed_trace def list_optimization_jobs( @@ -9865,10 +9991,10 @@ namespace azure.ai.projects.operations order: Optional[Union[str, PageOrder]] = ..., status: Optional[Union[str, JobStatus]] = ..., **kwargs: Any - ) -> ItemPaged[OptimizationJobListItem]: ... + ) -> ItemPaged[AgentOptimizationJobListItem]: ... - class azure.ai.projects.operations.BetaDatasetsOperations: + class azure.ai.projects.operations.BetaDatasetsOperations(BetaDatasetsOperationsGenerated): def __init__( self, @@ -9884,7 +10010,7 @@ namespace azure.ai.projects.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> LROPoller[DataGenerationJobResult]: ... + ) -> DatasetGenerationLROPoller: ... @overload def begin_create_generation_job( @@ -9894,7 +10020,7 @@ namespace azure.ai.projects.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> LROPoller[DataGenerationJobResult]: ... + ) -> DatasetGenerationLROPoller: ... @overload def begin_create_generation_job( @@ -9904,7 +10030,7 @@ namespace azure.ai.projects.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> LROPoller[DataGenerationJobResult]: ... + ) -> DatasetGenerationLROPoller: ... @distributed_trace def cancel_generation_job( @@ -10030,7 +10156,7 @@ namespace azure.ai.projects.operations ) -> EvaluationTaxonomy: ... - class azure.ai.projects.operations.BetaEvaluatorsOperations: + class azure.ai.projects.operations.BetaEvaluatorsOperations(BetaEvaluatorsOperationsGenerated): def __init__( self, @@ -10046,7 +10172,7 @@ namespace azure.ai.projects.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> LROPoller[EvaluatorVersion]: ... + ) -> EvaluatorGenerationLROPoller: ... @overload def begin_create_generation_job( @@ -10056,7 +10182,7 @@ namespace azure.ai.projects.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> LROPoller[EvaluatorVersion]: ... + ) -> EvaluatorGenerationLROPoller: ... @overload def begin_create_generation_job( @@ -10066,7 +10192,7 @@ namespace azure.ai.projects.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> LROPoller[EvaluatorVersion]: ... + ) -> EvaluatorGenerationLROPoller: ... @distributed_trace def cancel_generation_job( diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index 3d493abef420..35b0e28ce857 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: 544c82773e2ee8b4aeb0ece5b64bb938f2d3703720950214d3e4c5c98e3e61fd +apiMdSha256: 62166d91ac1bf1f19ad5e19f8c7f52d555549de596f086637a40e4223a1c1b47 parserVersion: 0.3.30 pythonVersion: 3.14.3 diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index fd4f2a8e648b..a0a658f4a27d 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -6,6 +6,8 @@ "azure.ai.projects.models.ToolboxTool": "Azure.AI.Projects.ToolboxTool", "azure.ai.projects.models.A2APreviewToolboxTool": "Azure.AI.Projects.A2APreviewToolboxTool", "azure.ai.projects.models.A2AProtocolConfiguration": "Azure.AI.Projects.A2AProtocolConfiguration", + "azure.ai.projects.models.A2ATool": "Azure.AI.Projects.A2ATool", + "azure.ai.projects.models.A2AToolboxTool": "Azure.AI.Projects.A2AToolboxTool", "azure.ai.projects.models.ActivityProtocolConfiguration": "Azure.AI.Projects.ActivityProtocolConfiguration", "azure.ai.projects.models.AgentBlueprintReference": "Azure.AI.Projects.AgentBlueprintReference", "azure.ai.projects.models.AgentCard": "Azure.AI.Projects.AgentCard", @@ -26,6 +28,19 @@ "azure.ai.projects.models.AgenticIdentityPreviewCredentials": "Azure.AI.Projects.AgenticIdentityPreviewCredentials", "azure.ai.projects.models.AgentIdentity": "Azure.AI.Projects.AgentIdentity", "azure.ai.projects.models.AgentObjectVersions": "Azure.AI.Projects.AgentObject.versions.anonymous", + "azure.ai.projects.models.AgentOptimizationCandidate": "Azure.AI.Projects.AgentOptimizationCandidate", + "azure.ai.projects.models.AgentOptimizationDatasetCriterion": "Azure.AI.Projects.AgentOptimizationDatasetCriterion", + "azure.ai.projects.models.AgentOptimizationDatasetInput": "Azure.AI.Projects.AgentOptimizationDatasetInput", + "azure.ai.projects.models.AgentOptimizationDatasetItem": "Azure.AI.Projects.AgentOptimizationDatasetItem", + "azure.ai.projects.models.AgentOptimizationEvaluatorRef": "Azure.AI.Projects.AgentOptimizationEvaluatorRef", + "azure.ai.projects.models.AgentOptimizationInlineDatasetInput": "Azure.AI.Projects.AgentOptimizationInlineDatasetInput", + "azure.ai.projects.models.AgentOptimizationJob": "Azure.AI.Projects.AgentOptimizationJob", + "azure.ai.projects.models.AgentOptimizationJobInputs": "Azure.AI.Projects.AgentOptimizationJobInputs", + "azure.ai.projects.models.AgentOptimizationJobListItem": "Azure.AI.Projects.AgentOptimizationJobListItem", + "azure.ai.projects.models.AgentOptimizationJobProgress": "Azure.AI.Projects.AgentOptimizationJobProgress", + "azure.ai.projects.models.AgentOptimizationJobResult": "Azure.AI.Projects.AgentOptimizationJobResult", + "azure.ai.projects.models.AgentOptimizationOptions": "Azure.AI.Projects.AgentOptimizationOptions", + "azure.ai.projects.models.AgentOptimizationReferenceDatasetInput": "Azure.AI.Projects.AgentOptimizationReferenceDatasetInput", "azure.ai.projects.models.AgentSessionResource": "Azure.AI.Projects.AgentSessionResource", "azure.ai.projects.models.EvaluationTaxonomyInput": "Azure.AI.Projects.EvaluationTaxonomyInput", "azure.ai.projects.models.AgentTaxonomyInput": "Azure.AI.Projects.AgentTaxonomyInput", @@ -247,20 +262,7 @@ "azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme": "Azure.AI.Projects.OpenApiProjectConnectionSecurityScheme", "azure.ai.projects.models.OpenApiTool": "Azure.AI.Projects.OpenApiTool", "azure.ai.projects.models.OpenApiToolboxTool": "Azure.AI.Projects.OpenApiToolboxTool", - "azure.ai.projects.models.OptimizationAgentIdentifier": "Azure.AI.Projects.OptimizationAgentIdentifier", - "azure.ai.projects.models.OptimizationCandidate": "Azure.AI.Projects.OptimizationCandidate", - "azure.ai.projects.models.OptimizationDatasetCriterion": "Azure.AI.Projects.OptimizationDatasetCriterion", - "azure.ai.projects.models.OptimizationDatasetInput": "Azure.AI.Projects.OptimizationDatasetInput", - "azure.ai.projects.models.OptimizationDatasetItem": "Azure.AI.Projects.OptimizationDatasetItem", - "azure.ai.projects.models.OptimizationEvaluatorRef": "Azure.AI.Projects.OptimizationEvaluatorRef", - "azure.ai.projects.models.OptimizationInlineDatasetInput": "Azure.AI.Projects.OptimizationInlineDatasetInput", - "azure.ai.projects.models.OptimizationJob": "Azure.AI.Projects.OptimizationJob", - "azure.ai.projects.models.OptimizationJobInputs": "Azure.AI.Projects.OptimizationJobInputs", - "azure.ai.projects.models.OptimizationJobListItem": "Azure.AI.Projects.OptimizationJobListItem", - "azure.ai.projects.models.OptimizationJobProgress": "Azure.AI.Projects.OptimizationJobProgress", - "azure.ai.projects.models.OptimizationJobResult": "Azure.AI.Projects.OptimizationJobResult", - "azure.ai.projects.models.OptimizationOptions": "Azure.AI.Projects.OptimizationOptions", - "azure.ai.projects.models.OptimizationReferenceDatasetInput": "Azure.AI.Projects.OptimizationReferenceDatasetInput", + "azure.ai.projects.models.OptimizedAgentIdentifier": "Azure.AI.Projects.OptimizedAgentIdentifier", "azure.ai.projects.models.TelemetryEndpoint": "Azure.AI.Projects.TelemetryEndpoint", "azure.ai.projects.models.OtlpTelemetryEndpoint": "Azure.AI.Projects.OtlpTelemetryEndpoint", "azure.ai.projects.models.PendingUploadRequest": "Azure.AI.Projects.PendingUploadRequest", @@ -297,6 +299,7 @@ "azure.ai.projects.models.SharepointGroundingToolParameters": "Azure.AI.Projects.SharepointGroundingToolParameters", "azure.ai.projects.models.SharepointPreviewTool": "Azure.AI.Projects.SharepointPreviewTool", "azure.ai.projects.models.SimpleQnADataGenerationJobOptions": "Azure.AI.Projects.SimpleQnADataGenerationJobOptions", + "azure.ai.projects.models.SimulationSeedDataGenerationJobOptions": "Azure.AI.Projects.SimulationSeedDataGenerationJobOptions", "azure.ai.projects.models.SkillDetails": "Azure.AI.Projects.Skill", "azure.ai.projects.models.SkillInlineContent": "Azure.AI.Projects.SkillInlineContent", "azure.ai.projects.models.SkillReferenceParam": "OpenAI.SkillReferenceParam", @@ -306,7 +309,6 @@ "azure.ai.projects.models.SpecificFunctionShellParam": "OpenAI.SpecificFunctionShellParam", "azure.ai.projects.models.StructuredInputDefinition": "Azure.AI.Projects.StructuredInputDefinition", "azure.ai.projects.models.StructuredOutputDefinition": "Azure.AI.Projects.StructuredOutputDefinition", - "azure.ai.projects.models.TaskGenerationDataGenerationJobOptions": "Azure.AI.Projects.TaskGenerationDataGenerationJobOptions", "azure.ai.projects.models.TaxonomyCategory": "Azure.AI.Projects.TaxonomyCategory", "azure.ai.projects.models.TaxonomySubCategory": "Azure.AI.Projects.TaxonomySubCategory", "azure.ai.projects.models.TelemetryConfig": "Azure.AI.Projects.TelemetryConfig", @@ -360,6 +362,7 @@ "azure.ai.projects.models.WorkIQPreviewToolboxTool": "Azure.AI.Projects.WorkIQPreviewToolboxTool", "azure.ai.projects.models.EvaluationTaxonomyInputType": "Azure.AI.Projects.EvaluationTaxonomyInputType", "azure.ai.projects.models.ToolType": "OpenAI.ToolType", + "azure.ai.projects.models.A2AProtocolVersion": "Azure.AI.Projects.A2AProtocolVersion", "azure.ai.projects.models.AzureAISearchQueryType": "Azure.AI.Projects.AzureAISearchQueryType", "azure.ai.projects.models.ContainerMemoryLimit": "OpenAI.ContainerMemoryLimit", "azure.ai.projects.models.ContainerNetworkPolicyParamType": "OpenAI.ContainerNetworkPolicyParamType", @@ -420,9 +423,10 @@ "azure.ai.projects.models.SimpleQnAFineTuningQuestionType": "Azure.AI.Projects.SimpleQnAFineTuningQuestionType", "azure.ai.projects.models.DataGenerationJobScenario": "Azure.AI.Projects.DataGenerationJobScenario", "azure.ai.projects.models.DataGenerationJobOutputType": "Azure.AI.Projects.DataGenerationJobOutputType", - "azure.ai.projects.models.OptimizationDatasetInputType": "Azure.AI.Projects.OptimizationDatasetInputType", + "azure.ai.projects.models.AgentOptimizationDatasetInputType": "Azure.AI.Projects.AgentOptimizationDatasetInputType", "azure.ai.projects.models.AgentObjectType": "Azure.AI.Projects.AgentObjectType", "azure.ai.projects.models.AgentState": "Azure.AI.Projects.AgentState", + "azure.ai.projects.models.AgentStateSource": "Azure.AI.Projects.AgentStateSource", "azure.ai.projects.models.AgentKind": "Azure.AI.Projects.AgentKind", "azure.ai.projects.models.AgentEndpointProtocol": "Azure.AI.Projects.AgentEndpointProtocol", "azure.ai.projects.models.CodeDependencyResolution": "Azure.AI.Projects.CodeDependencyResolution", @@ -548,5 +552,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": "856df4c68403" + "CrossLanguageVersion": "6178e51a6cdd" } \ No newline at end of file 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 3fa6b6d4831f..602c3a5f5b94 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.4.0" +VERSION = "2.5.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 fc836a471ebe..42d02ddfe0b5 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 @@ -11244,7 +11244,12 @@ async def disable(self, routine_name: str, **kwargs: Any) -> _models.Routine: @distributed_trace def list( - self, *, limit: Optional[int] = None, before: Optional[str] = None, order: Optional[str] = None, **kwargs: Any + self, + *, + limit: Optional[int] = None, + after: Optional[str] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + **kwargs: Any ) -> AsyncItemPaged["_models.Routine"]: """List routines. @@ -11252,12 +11257,14 @@ def list( :keyword limit: The maximum number of routines to return. Default value is None. :paramtype limit: int - :keyword before: Unsupported. Reserved for future backward pagination support. Default value is - None. - :paramtype before: str - :keyword order: The ordering direction. Supported values are asc and desc. Default value is - None. - :paramtype order: str + :keyword after: An opaque continuation token identifying where to resume the list. Prefer + following the ``next_link`` returned by the previous response, which embeds this value. Default + value is None. + :paramtype after: str + :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 :return: An iterator like instance of Routine :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Routine] :raises ~azure.core.exceptions.HttpResponseError: @@ -11275,21 +11282,47 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + def prepare_request(next_link=None): + if not next_link: + + _request = build_beta_routines_list_request( + limit=limit, + after=after, + order=order, + 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) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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) - _request = build_beta_routines_list_request( - limit=limit, - after=_continuation_token, - before=before, - order=order, - 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): @@ -11300,10 +11333,10 @@ async def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, AsyncList(list_of_elem) + return deserialized.get("next_link") or None, AsyncList(list_of_elem) - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + async def get_next(next_link=None): + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access @@ -11384,8 +11417,8 @@ def list_runs( *, filter: Optional[str] = None, limit: Optional[int] = None, - before: Optional[str] = None, - order: Optional[str] = None, + after: Optional[str] = None, + order: Optional[Union[str, _models.PageOrder]] = None, **kwargs: Any ) -> AsyncItemPaged["_models.RoutineRun"]: """List prior runs for a routine. @@ -11399,12 +11432,14 @@ def list_runs( :paramtype filter: str :keyword limit: The maximum number of runs to return. Default value is None. :paramtype limit: int - :keyword before: Unsupported. Reserved for future backward pagination support. Default value is - None. - :paramtype before: str - :keyword order: The ordering direction. Supported values are asc and desc. Default value is - None. - :paramtype order: str + :keyword after: An opaque continuation token identifying where to resume the list. Prefer + following the ``next_link`` returned by the previous response, which embeds this value. Default + value is None. + :paramtype after: str + :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 :return: An iterator like instance of RoutineRun :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.RoutineRun] :raises ~azure.core.exceptions.HttpResponseError: @@ -11422,23 +11457,49 @@ def list_runs( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + def prepare_request(next_link=None): + if not next_link: + + _request = build_beta_routines_list_runs_request( + routine_name=routine_name, + filter=filter, + limit=limit, + after=after, + order=order, + 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) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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) - _request = build_beta_routines_list_runs_request( - routine_name=routine_name, - filter=filter, - limit=limit, - after=_continuation_token, - before=before, - order=order, - 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): @@ -11449,10 +11510,10 @@ async def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, AsyncList(list_of_elem) + return deserialized.get("next_link") or None, AsyncList(list_of_elem) - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + async def get_next(next_link=None): + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access @@ -13770,7 +13831,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") async def _create_optimization_job_initial( - self, job: Union[_models.OptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any + self, + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13840,35 +13905,36 @@ async def _create_optimization_job_initial( @overload async def begin_create_optimization_job( self, - job: _models.OptimizationJob, + job: _models.AgentOptimizationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.OptimizationJobResult]: + ) -> AsyncLROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.OptimizationJob + :type job: ~azure.ai.projects.models.AgentOptimizationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OptimizationJobResult. The - OptimizationJobResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of AsyncLROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def begin_create_optimization_job( self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.OptimizationJobResult]: + ) -> AsyncLROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent @@ -13882,9 +13948,10 @@ async def begin_create_optimization_job( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OptimizationJobResult. The - OptimizationJobResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of AsyncLROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -13896,7 +13963,7 @@ async def begin_create_optimization_job( operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.OptimizationJobResult]: + ) -> AsyncLROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent @@ -13910,37 +13977,43 @@ async def begin_create_optimization_job( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OptimizationJobResult. The - OptimizationJobResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of AsyncLROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def begin_create_optimization_job( - self, job: Union[_models.OptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OptimizationJobResult]: + self, + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. - :param job: The job to create. Is one of the following types: OptimizationJob, JSON, IO[bytes] - Required. - :type job: ~azure.ai.projects.models.OptimizationJob or JSON or IO[bytes] + :param job: The job to create. Is one of the following types: AgentOptimizationJob, JSON, + IO[bytes] Required. + :type job: ~azure.ai.projects.models.AgentOptimizationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str - :return: An instance of AsyncLROPoller that returns OptimizationJobResult. The - OptimizationJobResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of AsyncLROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OptimizationJobResult] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentOptimizationJobResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -13965,7 +14038,7 @@ def get_long_running_output(pipeline_response): ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - deserialized = _deserialize(_models.OptimizationJobResult, response.json().get("result", {})) + deserialized = _deserialize(_models.AgentOptimizationJobResult, response.json().get("result", {})) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized @@ -13984,26 +14057,26 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.OptimizationJobResult].from_continuation_token( + return AsyncLROPoller[_models.AgentOptimizationJobResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.OptimizationJobResult]( + return AsyncLROPoller[_models.AgentOptimizationJobResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace_async - async def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: + async def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOptimizationJob: """Get an agent optimization job. Retrieves an optimization job by its identifier. :param job_id: The ID of the job. Required. :type job_id: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: AgentOptimizationJob. The AgentOptimizationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentOptimizationJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -14017,7 +14090,7 @@ async def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Opti _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentOptimizationJob] = kwargs.pop("cls", None) _request = build_beta_agents_get_optimization_job_request( job_id=job_id, @@ -14057,7 +14130,7 @@ async def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Opti if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.OptimizationJob, response.json()) + deserialized = _deserialize(_models.AgentOptimizationJob, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -14074,7 +14147,7 @@ def list_optimization_jobs( status: Optional[Union[str, _models.JobStatus]] = None, agent_name: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.OptimizationJobListItem"]: + ) -> AsyncItemPaged["_models.AgentOptimizationJobListItem"]: """List agent optimization jobs. Lists optimization jobs with cursor pagination and optional status or agent name filters. @@ -14098,15 +14171,15 @@ def list_optimization_jobs( :paramtype status: str or ~azure.ai.projects.models.JobStatus :keyword agent_name: Filter to jobs targeting this agent name. Default value is None. :paramtype agent_name: str - :return: An iterator like instance of OptimizationJobListItem + :return: An iterator like instance of AgentOptimizationJobListItem :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.OptimizationJobListItem] + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.AgentOptimizationJobListItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.OptimizationJobListItem]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AgentOptimizationJobListItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -14138,7 +14211,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.OptimizationJobListItem], + List[_models.AgentOptimizationJobListItem], deserialized.get("data", []), ) if cls: @@ -14167,7 +14240,7 @@ async def get_next(_continuation_token=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: + async def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOptimizationJob: """Cancel an agent optimization job. Requests cancellation of a running or queued job and returns an error if the job is already in @@ -14175,8 +14248,8 @@ async def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.O :param job_id: The ID of the job to cancel. Required. :type job_id: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: AgentOptimizationJob. The AgentOptimizationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentOptimizationJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -14190,7 +14263,7 @@ async def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.O _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentOptimizationJob] = kwargs.pop("cls", None) _request = build_beta_agents_cancel_optimization_job_request( job_id=job_id, @@ -14227,7 +14300,7 @@ async def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.O if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.OptimizationJob, response.json()) + deserialized = _deserialize(_models.AgentOptimizationJob, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py index 5d8893177cae..5bb74cf4fe6d 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py @@ -9,8 +9,9 @@ """ from typing import Any, List -from ._patch_agents_async import AgentsOperations -from ._patch_datasets_async import DatasetsOperations +from ._patch_agents_async import AgentsOperations, BetaAgentsOperations +from ._patch_datasets_async import BetaDatasetsOperations, DatasetsOperations +from ._patch_evaluators_async import BetaEvaluatorsOperations from ._patch_evaluation_rules_async import EvaluationRulesOperations from ._patch_telemetry_async import TelemetryOperations from ._patch_connections_async import ConnectionsOperations @@ -18,10 +19,7 @@ from ._patch_models_async import BetaModelsOperations from ...operations._patch import _BETA_OPERATION_FEATURE_HEADERS, _OperationMethodHeaderProxy from ._operations import ( - BetaAgentsOperations, - BetaDatasetsOperations, BetaEvaluationTaxonomiesOperations, - BetaEvaluatorsOperations, BetaInsightsOperations, BetaOperations as GeneratedBetaOperations, BetaRedTeamsOperations, @@ -66,14 +64,16 @@ class BetaOperations(GeneratedBetaOperations): def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - # Replace with patched class that includes upload() + # Replace with patched class that returns AsyncEvaluatorGenerationLROPoller self.evaluators = BetaEvaluatorsOperations(self._client, self._config, self._serialize, self._deserialize) - # Replace with patched class that adds file-path overload to upload_session_file + # Replace with patched class that returns AsyncAgentOptimizationLROPoller self.agents = BetaAgentsOperations(self._client, self._config, self._serialize, self._deserialize) # Replace with patched class that includes begin_update_memories self.memory_stores = BetaMemoryStoresOperations(self._client, self._config, self._serialize, self._deserialize) # Replace with patched class that includes create (3-step upload helper) self.models = BetaModelsOperations(self._client, self._config, self._serialize, self._deserialize) + # Replace with patched class that returns AsyncDatasetGenerationLROPoller + self.datasets = BetaDatasetsOperations(self._client, self._config, self._serialize, self._deserialize) for property_name, foundry_features_value in _BETA_OPERATION_FEATURE_HEADERS.items(): setattr( diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py index cd906a8d8498..adece538505b 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py @@ -8,11 +8,21 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Union, Optional, Any, IO, overload +from typing import Union, Optional, Any, IO, cast, overload from azure.core.exceptions import HttpResponseError +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod +from azure.core.polling.async_base_polling import AsyncLROBasePolling from azure.core.tracing.decorator_async import distributed_trace_async -from ._operations import AgentsOperations as GeneratedAgentsOperations, JSON, _Unset +from azure.core.utils import case_insensitive_dict +from ._operations import ( + AgentsOperations as GeneratedAgentsOperations, + BetaAgentsOperations as BetaAgentsOperationsGenerated, + JSON, + _Unset, +) from ... import models as _models +from ..._utils.model_base import _deserialize +from ...models import AsyncAgentOptimizationLROPoller from ...operations._patch_agents import _compute_sha256_from_stream from ...models._patch import ( _FOUNDRY_FEATURES_HEADER_NAME, @@ -314,3 +324,116 @@ async def create_version_from_code( new_exc.model = exc.model raise new_exc from exc raise + + +class BetaAgentsOperations(BetaAgentsOperationsGenerated): + """Custom async operations for beta agent optimization jobs.""" + + @overload + async def begin_create_optimization_job( + self, + job: _models.AgentOptimizationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> AsyncAgentOptimizationLROPoller: ... + + @overload + async def begin_create_optimization_job( + self, + job: JSON, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> AsyncAgentOptimizationLROPoller: ... + + @overload + async def begin_create_optimization_job( + self, + job: IO[bytes], + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> AsyncAgentOptimizationLROPoller: ... + + @distributed_trace_async + async def begin_create_optimization_job( + self, + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any, + ) -> AsyncAgentOptimizationLROPoller: + """Create an agent optimization job. + + :param job: The job to create. Required. + :type job: ~azure.ai.projects.models.AgentOptimizationJob or JSON or IO[bytes] + :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the + server creates the job unconditionally. Default value is None. + :paramtype operation_id: str + :return: A poller that returns AgentOptimizationJobResult and exposes the job ID in ``details``. + :rtype: ~azure.ai.projects.models.AsyncAgentOptimizationLROPoller + :raises ~azure.core.exceptions.HttpResponseError: + """ + headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", headers.pop("Content-Type", None)) + cls = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + continuation_token: Optional[str] = kwargs.pop("continuation_token", None) + raw_result = None + if continuation_token is None: + raw_result = await self._create_optimization_job_initial( + job=job, + operation_id=operation_id, + content_type=content_type, + cls=lambda x, y, z: x, + headers=headers, + params=params, + **kwargs, + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.AgentOptimizationJobResult, response.json().get("result", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if continuation_token: + return AsyncAgentOptimizationLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=continuation_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + assert raw_result is not None + return AsyncAgentOptimizationLROPoller( # type: ignore + self._client, raw_result, get_long_running_output, polling_method + ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py index dc7095c827ea..6612e31eacad 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py @@ -11,13 +11,23 @@ import os import re import logging -from typing import Any, Tuple, Optional +from typing import Any, IO, Tuple, Optional, Union, cast, overload +from collections.abc import MutableMapping from pathlib import Path from urllib.parse import urlsplit from azure.storage.blob.aio import ContainerClient +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod +from azure.core.polling.async_base_polling import AsyncLROBasePolling from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict -from ._operations import DatasetsOperations as DatasetsOperationsGenerated +from ._operations import ( + BetaDatasetsOperations as BetaDatasetsOperationsGenerated, + DatasetsOperations as DatasetsOperationsGenerated, +) +from ... import models as _models +from ..._utils.model_base import _deserialize +from ...models import AsyncDatasetGenerationLROPoller from ...models._models import ( FileDatasetVersion, FolderDatasetVersion, @@ -28,6 +38,121 @@ logger = logging.getLogger(__name__) +JSON = MutableMapping[str, Any] + + +class BetaDatasetsOperations(BetaDatasetsOperationsGenerated): + """Custom async operations for beta data generation jobs.""" + + @overload + async def begin_create_generation_job( + self, + job: _models.DataGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> AsyncDatasetGenerationLROPoller: ... + + @overload + async def begin_create_generation_job( + self, + job: JSON, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> AsyncDatasetGenerationLROPoller: ... + + @overload + async def begin_create_generation_job( + self, + job: IO[bytes], + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> AsyncDatasetGenerationLROPoller: ... + + @distributed_trace_async + async def begin_create_generation_job( + self, + job: Union[_models.DataGenerationJob, JSON, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any, + ) -> AsyncDatasetGenerationLROPoller: + """Create a data generation job. + + :param job: The job to create. Required. + :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] + :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the + server creates the job unconditionally. Default value is None. + :paramtype operation_id: str + :return: A poller that returns DataGenerationJobResult and exposes the job ID in ``details``. + :rtype: ~azure.ai.projects.models.AsyncDatasetGenerationLROPoller + :raises ~azure.core.exceptions.HttpResponseError: + """ + headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", headers.pop("Content-Type", None)) + cls = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + continuation_token: Optional[str] = kwargs.pop("continuation_token", None) + raw_result = None + if continuation_token is None: + raw_result = await self._create_generation_job_initial( + job=job, + operation_id=operation_id, + content_type=content_type, + cls=lambda x, y, z: x, + headers=headers, + params=params, + **kwargs, + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.DataGenerationJobResult, response.json().get("result", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if continuation_token: + return AsyncDatasetGenerationLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=continuation_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + assert raw_result is not None + return AsyncDatasetGenerationLROPoller( # type: ignore + self._client, raw_result, get_long_running_output, polling_method + ) + class DatasetsOperations(DatasetsOperationsGenerated): """ diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluators_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluators_async.py new file mode 100644 index 000000000000..50876c48cdfe --- /dev/null +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluators_async.py @@ -0,0 +1,134 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Custom async evaluator operations.""" + +from collections.abc import MutableMapping +from typing import Any, IO, Optional, Union, cast, overload + +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod +from azure.core.polling.async_base_polling import AsyncLROBasePolling +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict + +from ._operations import BetaEvaluatorsOperations as BetaEvaluatorsOperationsGenerated +from ... import models as _models +from ..._utils.model_base import _deserialize +from ...models import AsyncEvaluatorGenerationLROPoller + +JSON = MutableMapping[str, Any] + + +class BetaEvaluatorsOperations(BetaEvaluatorsOperationsGenerated): + """Custom async operations for beta evaluator generation jobs.""" + + @overload + async def begin_create_generation_job( + self, + job: _models.EvaluatorGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> AsyncEvaluatorGenerationLROPoller: ... + + @overload + async def begin_create_generation_job( + self, + job: JSON, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> AsyncEvaluatorGenerationLROPoller: ... + + @overload + async def begin_create_generation_job( + self, + job: IO[bytes], + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> AsyncEvaluatorGenerationLROPoller: ... + + @distributed_trace_async + async def begin_create_generation_job( + self, + job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any, + ) -> AsyncEvaluatorGenerationLROPoller: + """Create an evaluator generation job. + + :param job: The job to create. Required. + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] + :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the + server creates the job unconditionally. Default value is None. + :paramtype operation_id: str + :return: A poller that returns EvaluatorVersion and exposes the job ID in ``details``. + :rtype: ~azure.ai.projects.models.AsyncEvaluatorGenerationLROPoller + :raises ~azure.core.exceptions.HttpResponseError: + """ + headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", headers.pop("Content-Type", None)) + cls = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + continuation_token: Optional[str] = kwargs.pop("continuation_token", None) + raw_result = None + if continuation_token is None: + raw_result = await self._create_generation_job_initial( + job=job, + operation_id=operation_id, + content_type=content_type, + cls=lambda x, y, z: x, + headers=headers, + params=params, + **kwargs, + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.EvaluatorVersion, response.json().get("result", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if continuation_token: + return AsyncEvaluatorGenerationLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=continuation_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + assert raw_result is not None + return AsyncEvaluatorGenerationLROPoller( # type: ignore + self._client, raw_result, get_long_running_output, polling_method + ) 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 e490237abf83..0f5dac771256 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 @@ -17,6 +17,8 @@ A2APreviewTool, A2APreviewToolboxTool, A2AProtocolConfiguration, + A2ATool, + A2AToolboxTool, AISearchIndexResource, ActivityProtocolConfiguration, AgentBlueprintReference, @@ -32,6 +34,19 @@ AgentEvaluatorGenerationJobSource, AgentIdentity, AgentObjectVersions, + AgentOptimizationCandidate, + AgentOptimizationDatasetCriterion, + AgentOptimizationDatasetInput, + AgentOptimizationDatasetItem, + AgentOptimizationEvaluatorRef, + AgentOptimizationInlineDatasetInput, + AgentOptimizationJob, + AgentOptimizationJobInputs, + AgentOptimizationJobListItem, + AgentOptimizationJobProgress, + AgentOptimizationJobResult, + AgentOptimizationOptions, + AgentOptimizationReferenceDatasetInput, AgentSessionResource, AgentTaxonomyInput, AgentVersionDetails, @@ -249,20 +264,7 @@ OpenApiProjectConnectionSecurityScheme, OpenApiTool, OpenApiToolboxTool, - OptimizationAgentIdentifier, - OptimizationCandidate, - OptimizationDatasetCriterion, - OptimizationDatasetInput, - OptimizationDatasetItem, - OptimizationEvaluatorRef, - OptimizationInlineDatasetInput, - OptimizationJob, - OptimizationJobInputs, - OptimizationJobListItem, - OptimizationJobProgress, - OptimizationJobResult, - OptimizationOptions, - OptimizationReferenceDatasetInput, + OptimizedAgentIdentifier, OtlpTelemetryEndpoint, PendingUploadRequest, PendingUploadResponse, @@ -304,6 +306,7 @@ SharepointGroundingToolParameters, SharepointPreviewTool, SimpleQnADataGenerationJobOptions, + SimulationSeedDataGenerationJobOptions, SkillDetails, SkillInlineContent, SkillReferenceParam, @@ -312,7 +315,6 @@ SpecificFunctionShellParam, StructuredInputDefinition, StructuredOutputDefinition, - TaskGenerationDataGenerationJobOptions, TaxonomyCategory, TaxonomySubCategory, TelemetryConfig, @@ -374,14 +376,17 @@ ) from ._enums import ( # type: ignore + A2AProtocolVersion, AgentBlueprintReferenceType, AgentEndpointAuthorizationSchemeType, AgentEndpointProtocol, AgentIdentityStatus, AgentKind, AgentObjectType, + AgentOptimizationDatasetInputType, AgentSessionStatus, AgentState, + AgentStateSource, AgentVersionStatus, AttackStrategy, AzureAISearchQueryType, @@ -431,7 +436,6 @@ MemoryStoreUpdateStatus, OpenApiAuthType, OperationState, - OptimizationDatasetInputType, PageOrder, PendingUploadType, RankerVersionType, @@ -474,6 +478,8 @@ "A2APreviewTool", "A2APreviewToolboxTool", "A2AProtocolConfiguration", + "A2ATool", + "A2AToolboxTool", "AISearchIndexResource", "ActivityProtocolConfiguration", "AgentBlueprintReference", @@ -489,6 +495,19 @@ "AgentEvaluatorGenerationJobSource", "AgentIdentity", "AgentObjectVersions", + "AgentOptimizationCandidate", + "AgentOptimizationDatasetCriterion", + "AgentOptimizationDatasetInput", + "AgentOptimizationDatasetItem", + "AgentOptimizationEvaluatorRef", + "AgentOptimizationInlineDatasetInput", + "AgentOptimizationJob", + "AgentOptimizationJobInputs", + "AgentOptimizationJobListItem", + "AgentOptimizationJobProgress", + "AgentOptimizationJobResult", + "AgentOptimizationOptions", + "AgentOptimizationReferenceDatasetInput", "AgentSessionResource", "AgentTaxonomyInput", "AgentVersionDetails", @@ -706,20 +725,7 @@ "OpenApiProjectConnectionSecurityScheme", "OpenApiTool", "OpenApiToolboxTool", - "OptimizationAgentIdentifier", - "OptimizationCandidate", - "OptimizationDatasetCriterion", - "OptimizationDatasetInput", - "OptimizationDatasetItem", - "OptimizationEvaluatorRef", - "OptimizationInlineDatasetInput", - "OptimizationJob", - "OptimizationJobInputs", - "OptimizationJobListItem", - "OptimizationJobProgress", - "OptimizationJobResult", - "OptimizationOptions", - "OptimizationReferenceDatasetInput", + "OptimizedAgentIdentifier", "OtlpTelemetryEndpoint", "PendingUploadRequest", "PendingUploadResponse", @@ -761,6 +767,7 @@ "SharepointGroundingToolParameters", "SharepointPreviewTool", "SimpleQnADataGenerationJobOptions", + "SimulationSeedDataGenerationJobOptions", "SkillDetails", "SkillInlineContent", "SkillReferenceParam", @@ -769,7 +776,6 @@ "SpecificFunctionShellParam", "StructuredInputDefinition", "StructuredOutputDefinition", - "TaskGenerationDataGenerationJobOptions", "TaxonomyCategory", "TaxonomySubCategory", "TelemetryConfig", @@ -828,14 +834,17 @@ "WorkIQPreviewTool", "WorkIQPreviewToolboxTool", "WorkflowAgentDefinition", + "A2AProtocolVersion", "AgentBlueprintReferenceType", "AgentEndpointAuthorizationSchemeType", "AgentEndpointProtocol", "AgentIdentityStatus", "AgentKind", "AgentObjectType", + "AgentOptimizationDatasetInputType", "AgentSessionStatus", "AgentState", + "AgentStateSource", "AgentVersionStatus", "AttackStrategy", "AzureAISearchQueryType", @@ -885,7 +894,6 @@ "MemoryStoreUpdateStatus", "OpenApiAuthType", "OperationState", - "OptimizationDatasetInputType", "PageOrder", "PendingUploadType", "RankerVersionType", 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 b7f159dd935a..592c3f2ffa01 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 @@ -20,6 +20,8 @@ class _AgentDefinitionOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): """EXTERNAL_AGENTS_V1_PREVIEW.""" DRAFT_AGENTS_V1_PREVIEW = "DraftAgents=V1Preview" """DRAFT_AGENTS_V1_PREVIEW.""" + VOICE_AGENTS_V1_PREVIEW = "VoiceAgents=V1Preview" + """VOICE_AGENTS_V1_PREVIEW.""" class _FoundryFeaturesOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -35,8 +37,8 @@ class _FoundryFeaturesOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): """INSIGHTS_V1_PREVIEW.""" MEMORY_STORES_V1_PREVIEW = "MemoryStores=V1Preview" """MEMORY_STORES_V1_PREVIEW.""" - ROUTINES_V1_PREVIEW = "Routines=V1Preview" - """ROUTINES_V1_PREVIEW.""" + ROUTINES_V2_PREVIEW = "Routines=V2Preview" + """ROUTINES_V2_PREVIEW.""" SKILLS_V1_PREVIEW = "Skills=V1Preview" """SKILLS_V1_PREVIEW.""" DATA_GENERATION_JOBS_V1_PREVIEW = "DataGenerationJobs=V1Preview" @@ -47,6 +49,13 @@ class _FoundryFeaturesOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): """AGENTS_OPTIMIZATION_V2_PREVIEW.""" +class A2AProtocolVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Supported A2A protocol versions.""" + + V1_0 = "1.0" + """A2A protocol version 1.0.""" + + class AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of AgentBlueprintReferenceType.""" @@ -123,6 +132,15 @@ class AgentObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """AGENT_CONTAINER.""" +class AgentOptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Discriminator values for the dataset input union.""" + + INLINE = "inline" + """Inline dataset — items are provided directly in the request body.""" + REFERENCE = "reference" + """Reference to a registered Foundry dataset by name and version.""" + + class AgentSessionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The status of an agent session.""" @@ -153,6 +171,17 @@ class AgentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Agent endpoint rejects all requests.""" +class AgentStateSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the source of an agent's operational state. Empty when the state is not derived from + a specific source. + """ + + AGENT_INSTANCE_IDENTITY = "agent_instance_identity" + """The state is derived from the agent's instance identity.""" + AGENT_BLUEPRINT = "agent_blueprint" + """The state is derived from the agent's blueprint.""" + + class AgentVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The provisioning status of an agent version.""" @@ -403,8 +432,8 @@ class DataGenerationJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Single turn query and response from agent traces.""" TOOL_USE = "tool_use" """Tool calling conversation between user and agent.""" - TASK_GENERATION = "task_generation" - """Task generation for evaluation scenarios.""" + SIMULATION_SEED = "simulation_seed" + """Simulation seed for evaluation scenarios.""" class DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -799,15 +828,6 @@ class OperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The operation has been canceled by the user.""" -class OptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Discriminator values for the dataset input union.""" - - INLINE = "inline" - """Inline dataset — items are provided directly in the request body.""" - REFERENCE = "reference" - """Reference to a registered Foundry dataset by name and version.""" - - class PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of PageOrder.""" @@ -1119,6 +1139,8 @@ class ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """AZURE_AI_SEARCH.""" OPENAPI = "openapi" """OPENAPI.""" + A2_A = "a2a" + """A2_A.""" A2A_PREVIEW = "a2a_preview" """A2A_PREVIEW.""" BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" @@ -1228,6 +1250,8 @@ class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """FABRIC_IQ_PREVIEW.""" TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" """TOOLBOX_SEARCH_PREVIEW.""" + A2_A = "a2a" + """A2_A.""" AZURE_AI_SEARCH = "azure_ai_search" """AZURE_AI_SEARCH.""" AZURE_FUNCTION = "azure_function" 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 15d2e20c44f2..047ff53c1412 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 @@ -18,6 +18,7 @@ AgentEndpointAuthorizationSchemeType, AgentKind, AgentObjectType, + AgentOptimizationDatasetInputType, ContainerNetworkPolicyParamType, ContainerSkillType, CredentialType, @@ -38,7 +39,6 @@ MemoryStoreKind, MemoryStoreObjectType, OpenApiAuthType, - OptimizationDatasetInputType, PendingUploadType, RecurrenceType, RoutineActionType, @@ -156,7 +156,7 @@ class Tool(_Model): """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: - A2APreviewTool, ApplyPatchToolParam, AzureAISearchTool, AzureFunctionTool, + A2ATool, A2APreviewTool, ApplyPatchToolParam, AzureAISearchTool, AzureFunctionTool, BingCustomSearchPreviewTool, BingGroundingTool, BrowserAutomationPreviewTool, CaptureStructuredOutputsTool, CodeInterpreterTool, ComputerTool, ComputerUsePreviewTool, CustomToolParam, MicrosoftFabricPreviewTool, FabricIQPreviewTool, FileSearchTool, FunctionTool, @@ -169,7 +169,7 @@ class Tool(_Model): "local_shell", "shell", "custom", "namespace", "tool_search", "web_search_preview", "apply_patch", "a2a_preview", "bing_custom_search_preview", "browser_automation_preview", "fabric_dataagent_preview", "sharepoint_grounding_preview", "memory_search_preview", - "work_iq_preview", "fabric_iq_preview", "toolbox_search_preview", "azure_ai_search", + "work_iq_preview", "fabric_iq_preview", "toolbox_search_preview", "a2a", "azure_ai_search", "azure_function", "bing_grounding", "capture_structured_outputs", and "openapi". :vartype type: str or ~azure.ai.projects.models.ToolType """ @@ -182,8 +182,8 @@ class Tool(_Model): \"apply_patch\", \"a2a_preview\", \"bing_custom_search_preview\", \"browser_automation_preview\", \"fabric_dataagent_preview\", \"sharepoint_grounding_preview\", \"memory_search_preview\", \"work_iq_preview\", \"fabric_iq_preview\", - \"toolbox_search_preview\", \"azure_ai_search\", \"azure_function\", \"bing_grounding\", - \"capture_structured_outputs\", and \"openapi\".""" + \"toolbox_search_preview\", \"a2a\", \"azure_ai_search\", \"azure_function\", + \"bing_grounding\", \"capture_structured_outputs\", and \"openapi\".""" @overload def __init__( @@ -265,15 +265,16 @@ class ToolboxTool(_Model): """An abstract representation of a tool stored in a toolbox. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - A2APreviewToolboxTool, AzureAISearchToolboxTool, BrowserAutomationPreviewToolboxTool, - CodeInterpreterToolboxTool, FabricIQPreviewToolboxTool, FileSearchToolboxTool, MCPToolboxTool, - OpenApiToolboxTool, ReminderPreviewToolboxTool, ToolSearchToolboxTool, - ToolboxSearchPreviewToolboxTool, WebSearchToolboxTool, WorkIQPreviewToolboxTool + A2AToolboxTool, A2APreviewToolboxTool, AzureAISearchToolboxTool, + BrowserAutomationPreviewToolboxTool, CodeInterpreterToolboxTool, FabricIQPreviewToolboxTool, + FileSearchToolboxTool, MCPToolboxTool, OpenApiToolboxTool, ReminderPreviewToolboxTool, + ToolSearchToolboxTool, ToolboxSearchPreviewToolboxTool, WebSearchToolboxTool, + WorkIQPreviewToolboxTool :ivar type: The type of tool. Required. Known values are: "code_interpreter", "file_search", - "web_search", "mcp", "azure_ai_search", "openapi", "a2a_preview", "browser_automation_preview", - "reminder_preview", "work_iq_preview", "fabric_iq_preview", "toolbox_search", and - "toolbox_search_preview". + "web_search", "mcp", "azure_ai_search", "openapi", "a2a", "a2a_preview", + "browser_automation_preview", "reminder_preview", "work_iq_preview", "fabric_iq_preview", + "toolbox_search", and "toolbox_search_preview". :vartype type: str or ~azure.ai.projects.models.ToolboxToolType :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str @@ -288,7 +289,7 @@ class ToolboxTool(_Model): __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) """The type of tool. Required. Known values are: \"code_interpreter\", \"file_search\", - \"web_search\", \"mcp\", \"azure_ai_search\", \"openapi\", \"a2a_preview\", + \"web_search\", \"mcp\", \"azure_ai_search\", \"openapi\", \"a2a\", \"a2a_preview\", \"browser_automation_preview\", \"reminder_preview\", \"work_iq_preview\", \"fabric_iq_preview\", \"toolbox_search\", and \"toolbox_search_preview\".""" name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -396,6 +397,147 @@ class A2AProtocolConfiguration(_Model): """Configuration specific to the A2A protocol.""" +class A2ATool(Tool, discriminator="a2a"): + """An agent implementing the A2A protocol. + + :ivar type: The type of the tool. Always ``"a2a"``. Required. A2_A. + :vartype type: str or ~azure.ai.projects.models.A2_A + :ivar base_url: Base URL of the agent. + :vartype base_url: str + :ivar agent_card_path: The path to the agent card relative to the ``base_url``. If not + provided, defaults to ``/.well-known/agent-card.json``. + :vartype agent_card_path: str + :ivar project_connection_id: The connection ID in the project for the A2A server. The + connection stores authentication and other connection details needed to connect to the A2A + server. + :vartype project_connection_id: str + :ivar send_credentials_for_agent_card: When ``true``, Foundry sends its credentials when + fetching the remote agent's Agent Card. The service defaults to ``false`` if a value is not + specified by the caller (anonymous fetch). + :vartype send_credentials_for_agent_card: bool + :ivar a2_a_version: The A2A protocol version supported by the agent. Required. "1.0" + :vartype a2_a_version: str or ~azure.ai.projects.models.A2AProtocolVersion + """ + + type: Literal[ToolType.A2_A] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``\"a2a\"``. Required. A2_A.""" + base_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base URL of the agent.""" + agent_card_path: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The path to the agent card relative to the ``base_url``. If not provided, defaults to + ``/.well-known/agent-card.json``.""" + project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The connection ID in the project for the A2A server. The connection stores authentication and + other connection details needed to connect to the A2A server.""" + send_credentials_for_agent_card: Optional[bool] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """When ``true``, Foundry sends its credentials when fetching the remote agent's Agent Card. The + service defaults to ``false`` if a value is not specified by the caller (anonymous fetch).""" + a2_a_version: Union[str, "_models.A2AProtocolVersion"] = rest_field( + name="a2a_version", visibility=["read", "create", "update", "delete", "query"] + ) + """The A2A protocol version supported by the agent. Required. \"1.0\"""" + + @overload + def __init__( + self, + *, + a2_a_version: Union[str, "_models.A2AProtocolVersion"], + base_url: Optional[str] = None, + agent_card_path: Optional[str] = None, + project_connection_id: Optional[str] = None, + send_credentials_for_agent_card: 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 = ToolType.A2_A # type: ignore + + +class A2AToolboxTool(ToolboxTool, discriminator="a2a"): + """An A2A 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. A2_A. + :vartype type: str or ~azure.ai.projects.models.A2_A + :ivar base_url: Base URL of the agent. + :vartype base_url: str + :ivar agent_card_path: The path to the agent card relative to the ``base_url``. If not + provided, defaults to ``/.well-known/agent-card.json``. + :vartype agent_card_path: str + :ivar project_connection_id: The connection ID in the project for the A2A server. The + connection stores authentication and other connection details needed to connect to the A2A + server. + :vartype project_connection_id: str + :ivar send_credentials_for_agent_card: When ``true``, Foundry sends its credentials when + fetching the remote agent's Agent Card. The service defaults to ``false`` if a value is not + specified by the caller (anonymous fetch). + :vartype send_credentials_for_agent_card: bool + :ivar a2_a_version: The A2A protocol version supported by the agent. Required. "1.0" + :vartype a2_a_version: str or ~azure.ai.projects.models.A2AProtocolVersion + """ + + type: Literal[ToolboxToolType.A2_A] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. A2_A.""" + base_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base URL of the agent.""" + agent_card_path: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The path to the agent card relative to the ``base_url``. If not provided, defaults to + ``/.well-known/agent-card.json``.""" + project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The connection ID in the project for the A2A server. The connection stores authentication and + other connection details needed to connect to the A2A server.""" + send_credentials_for_agent_card: Optional[bool] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """When ``true``, Foundry sends its credentials when fetching the remote agent's Agent Card. The + service defaults to ``false`` if a value is not specified by the caller (anonymous fetch).""" + a2_a_version: Union[str, "_models.A2AProtocolVersion"] = rest_field( + name="a2a_version", visibility=["read", "create", "update", "delete", "query"] + ) + """The A2A protocol version supported by the agent. Required. \"1.0\"""" + + @overload + def __init__( + self, + *, + a2_a_version: Union[str, "_models.A2AProtocolVersion"], + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + base_url: Optional[str] = None, + agent_card_path: Optional[str] = None, + project_connection_id: Optional[str] = None, + send_credentials_for_agent_card: 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 = ToolboxToolType.A2_A # type: ignore + + class ActivityProtocolConfiguration(_Model): """Configuration specific to the activity protocol. @@ -824,6 +966,10 @@ class AgentDetails(_Model): :ivar state: The operational state of the agent. Controls whether the agent endpoint accepts or rejects requests. Required. Known values are: "enabled" and "disabled". :vartype state: str or ~azure.ai.projects.models.AgentState + :ivar state_source: The source of the agent's operational state. When the agent is disabled, + indicates where the disabled state originates from. Empty when not derived from a specific + source. Known values are: "agent_instance_identity" and "agent_blueprint". + :vartype state_source: str or ~azure.ai.projects.models.AgentStateSource :ivar versions: The latest version of the agent. Required. :vartype versions: ~azure.ai.projects.models.AgentObjectVersions :ivar agent_endpoint: The endpoint configuration for the agent. @@ -847,6 +993,10 @@ class AgentDetails(_Model): state: Union[str, "_models.AgentState"] = rest_field(visibility=["read"]) """The operational state of the agent. Controls whether the agent endpoint accepts or rejects requests. Required. Known values are: \"enabled\" and \"disabled\".""" + state_source: Optional[Union[str, "_models.AgentStateSource"]] = rest_field(visibility=["read"]) + """The source of the agent's operational state. When the agent is disabled, indicates where the + disabled state originates from. Empty when not derived from a specific source. Known values + are: \"agent_instance_identity\" and \"agent_blueprint\".""" versions: "_models.AgentObjectVersions" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The latest version of the agent. Required.""" agent_endpoint: Optional["_models.AgentEndpointConfig"] = rest_field( @@ -1183,53 +1333,59 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentSessionResource(_Model): - """An agent session providing a long-lived compute sandbox for hosted agent invocations. +class AgentOptimizationCandidate(_Model): + """Aggregated evaluation result for a single candidate agent configuration across all tasks. - :ivar agent_session_id: The session identifier. Required. - :vartype agent_session_id: str - :ivar version_indicator: The version indicator determining which agent version backs this - session. Required. - :vartype version_indicator: ~azure.ai.projects.models.VersionIndicator - :ivar status: The current status of the session. Required. Known values are: "creating", - "active", "idle", "updating", "failed", "deleting", "deleted", and "expired". - :vartype status: str or ~azure.ai.projects.models.AgentSessionStatus - :ivar created_at: The Unix timestamp (in seconds) when the session was created. Required. - :vartype created_at: ~datetime.datetime - :ivar last_accessed_at: The Unix timestamp (in seconds) when the session was last accessed. - Required. - :vartype last_accessed_at: ~datetime.datetime - :ivar expires_at: The Unix timestamp (in seconds) when the session expires (rolling, 30 days - from last activity). Required. - :vartype expires_at: ~datetime.datetime + :ivar candidate_id: Server-assigned candidate identifier. Use with GET /candidates/{id} + sub-endpoints. + :vartype candidate_id: str + :ivar name: Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required. + :vartype name: str + :ivar mutations: What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}). + :vartype mutations: dict[str, any] + :ivar avg_score: Average composite score across all tasks. Required. + :vartype avg_score: float + :ivar avg_tokens: Average token usage across all tasks. Required. + :vartype avg_tokens: float + :ivar eval_id: Foundry evaluation identifier used to score this candidate. + :vartype eval_id: str + :ivar eval_run_id: Foundry evaluation run identifier for this candidate's scoring run. + :vartype eval_run_id: str + :ivar promotion: Promotion metadata. Null if the candidate has not been promoted. + :vartype promotion: ~azure.ai.projects.models.PromotionInfo """ - agent_session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The session identifier. Required.""" - version_indicator: "_models.VersionIndicator" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The version indicator determining which agent version backs this session. Required.""" - status: Union[str, "_models.AgentSessionStatus"] = rest_field( + candidate_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Server-assigned candidate identifier. Use with GET /candidates/{id} sub-endpoints.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required.""" + mutations: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}).""" + avg_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Average composite score across all tasks. Required.""" + avg_tokens: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Average token usage across all tasks. Required.""" + eval_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Foundry evaluation identifier used to score this candidate.""" + eval_run_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Foundry evaluation run identifier for this candidate's scoring run.""" + promotion: Optional["_models.PromotionInfo"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The current status of the session. Required. Known values are: \"creating\", \"active\", - \"idle\", \"updating\", \"failed\", \"deleting\", \"deleted\", and \"expired\".""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) when the session was created. Required.""" - last_accessed_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) when the session was last accessed. Required.""" - expires_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity). - Required.""" + """Promotion metadata. Null if the candidate has not been promoted.""" @overload def __init__( self, *, - agent_session_id: str, - version_indicator: "_models.VersionIndicator", - status: Union[str, "_models.AgentSessionStatus"], + name: str, + avg_score: float, + avg_tokens: float, + candidate_id: Optional[str] = None, + mutations: Optional[dict[str, Any]] = None, + eval_id: Optional[str] = None, + eval_run_id: Optional[str] = None, + promotion: Optional["_models.PromotionInfo"] = None, ) -> None: ... @overload @@ -1243,26 +1399,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationTaxonomyInput(_Model): - """Input configuration for the evaluation taxonomy. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AgentTaxonomyInput +class AgentOptimizationDatasetCriterion(_Model): + """Evaluation criterion: a name + instruction pair used for per-item scoring. - :ivar type: Input type of the evaluation taxonomy. Required. Known values are: "agent" and - "policy". - :vartype type: str or ~azure.ai.projects.models.EvaluationTaxonomyInputType + :ivar name: Criterion name. Required. + :vartype name: str + :ivar instruction: Criterion instruction / description. Required. + :vartype instruction: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Input type of the evaluation taxonomy. Required. Known values are: \"agent\" and \"policy\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Criterion name. Required.""" + instruction: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Criterion instruction / description. Required.""" @overload def __init__( self, *, - type: str, + name: str, + instruction: str, ) -> None: ... @overload @@ -1276,32 +1432,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentTaxonomyInput(EvaluationTaxonomyInput, discriminator="agent"): - """Input configuration for the evaluation taxonomy when the input type is agent. +class AgentOptimizationDatasetInput(_Model): + """Base discriminated model for dataset input. Either inline items or a registered reference. - :ivar type: Input type of the evaluation taxonomy. Required. Agent. - :vartype type: str or ~azure.ai.projects.models.AGENT - :ivar target: Target configuration for the agent. Required. - :vartype target: ~azure.ai.projects.models.EvaluationTarget - :ivar risk_categories: List of risk categories to evaluate against. Required. - :vartype risk_categories: list[str or ~azure.ai.projects.models.RiskCategory] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AgentOptimizationInlineDatasetInput, AgentOptimizationReferenceDatasetInput + + :ivar type: Dataset input type discriminator. Required. Known values are: "inline" and + "reference". + :vartype type: str or ~azure.ai.projects.models.AgentOptimizationDatasetInputType """ - type: Literal[EvaluationTaxonomyInputType.AGENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Input type of the evaluation taxonomy. Required. Agent.""" - target: "_models.EvaluationTarget" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Target configuration for the agent. Required.""" - risk_categories: list[Union[str, "_models.RiskCategory"]] = rest_field( - name="riskCategories", visibility=["read", "create", "update", "delete", "query"] - ) - """List of risk categories to evaluate against. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Dataset input type discriminator. Required. Known values are: \"inline\" and \"reference\".""" @overload def __init__( self, *, - target: "_models.EvaluationTarget", - risk_categories: list[Union[str, "_models.RiskCategory"]], + type: str, ) -> None: ... @overload @@ -1313,112 +1463,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluationTaxonomyInputType.AGENT # type: ignore - -class AgentVersionDetails(_Model): - """AgentVersionDetails. - :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 AgentOptimizationDatasetItem(_Model): + """A single item in an inline dataset. - 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 object: The object type, which is always 'agent.version'. Required. AGENT_VERSION. - :vartype object: str or ~azure.ai.projects.models.AGENT_VERSION - :ivar id: The unique identifier of the agent version. Required. - :vartype id: str - :ivar name: The name of the agent. Name can be used to retrieve/update/delete the agent. - Required. - :vartype name: str - :ivar version: The version identifier of the agent. Agents are immutable and every update - creates a new version while keeping the name same. Required. - :vartype version: str - :ivar description: A human-readable description of the agent. - :vartype description: str - :ivar created_at: The Unix timestamp (seconds) when the agent was created. Required. - :vartype created_at: ~datetime.datetime - :ivar definition: Required. - :vartype definition: ~azure.ai.projects.models.AgentDefinition - :ivar draft: Whether this agent version is a draft (candidate) rather than a release. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. - Defaults to false. - :vartype draft: bool - :ivar status: The provisioning status of the agent version. Defaults to 'active' for non-hosted - agents. For hosted agents, reflects infrastructure readiness. Known values are: "creating", - "active", "failed", "deleting", and "deleted". - :vartype status: str or ~azure.ai.projects.models.AgentVersionStatus - :ivar instance_identity: The instance identity of the agent. - :vartype instance_identity: ~azure.ai.projects.models.AgentIdentity - :ivar blueprint: The blueprint for the agent. - :vartype blueprint: ~azure.ai.projects.models.AgentIdentity - :ivar blueprint_reference: The blueprint for the agent. - :vartype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference - :ivar agent_guid: The unique GUID identifier of the agent. - :vartype agent_guid: str + :ivar query: The user query / prompt. + :vartype query: str + :ivar ground_truth: Expected ground truth answer. + :vartype ground_truth: str + :ivar desired_num_turns: Desired number of conversation turns for simulation mode (1-20). + :vartype desired_num_turns: int + :ivar criteria: Per-item evaluation criteria. + :vartype criteria: list[~azure.ai.projects.models.AgentOptimizationDatasetCriterion] """ - 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.""" - object: Literal[AgentObjectType.AGENT_VERSION] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type, which is always 'agent.version'. Required. AGENT_VERSION.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the agent version. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the agent. Name can be used to retrieve/update/delete the agent. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version identifier of the agent. Agents are immutable and every update creates a new - version while keeping the name same. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the agent.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the agent was created. Required.""" - definition: "_models.AgentDefinition" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - draft: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this agent version is a draft (candidate) rather than a release. Draft versions are - recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to - false.""" - status: Optional[Union[str, "_models.AgentVersionStatus"]] = rest_field( + query: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The user query / prompt.""" + ground_truth: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Expected ground truth answer.""" + desired_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Desired number of conversation turns for simulation mode (1-20).""" + criteria: Optional[list["_models.AgentOptimizationDatasetCriterion"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For - hosted agents, reflects infrastructure readiness. Known values are: \"creating\", \"active\", - \"failed\", \"deleting\", and \"deleted\".""" - instance_identity: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) - """The instance identity of the agent.""" - blueprint: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) - """The blueprint for the agent.""" - blueprint_reference: Optional["_models.AgentBlueprintReference"] = rest_field(visibility=["read"]) - """The blueprint for the agent.""" - agent_guid: Optional[str] = rest_field(visibility=["read"]) - """The unique GUID identifier of the agent.""" + """Per-item evaluation criteria.""" @overload def __init__( self, *, - metadata: dict[str, str], - object: Literal[AgentObjectType.AGENT_VERSION], - id: str, # pylint: disable=redefined-builtin - name: str, - version: str, - created_at: datetime.datetime, - definition: "_models.AgentDefinition", - description: Optional[str] = None, - draft: Optional[bool] = None, - status: Optional[Union[str, "_models.AgentVersionStatus"]] = None, + query: Optional[str] = None, + ground_truth: Optional[str] = None, + desired_num_turns: Optional[int] = None, + criteria: Optional[list["_models.AgentOptimizationDatasetCriterion"]] = None, ) -> None: ... @overload @@ -1432,52 +1510,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AISearchIndexResource(_Model): - """A AI Search Index resource. +class AgentOptimizationEvaluatorRef(_Model): + """Reference to a named evaluator, optionally pinned to a version. - :ivar project_connection_id: An index connection ID in an IndexResource attached to this agent. - :vartype project_connection_id: str - :ivar index_name: The name of an index in an IndexResource attached to this agent. - :vartype index_name: str - :ivar query_type: Type of query in an AIIndexResource attached to this agent. Known values are: - "simple", "semantic", "vector", "vector_simple_hybrid", and "vector_semantic_hybrid". - :vartype query_type: str or ~azure.ai.projects.models.AzureAISearchQueryType - :ivar top_k: Number of documents to retrieve from search and present to the model. - :vartype top_k: int - :ivar filter: filter string for search resource. `Learn more here - `_. - :vartype filter: str - :ivar index_asset_id: Index asset id for search resource. - :vartype index_asset_id: str + :ivar name: Evaluator name. Required. + :vartype name: str + :ivar version: Evaluator version. If not specified, the latest version is used. + :vartype version: str """ - project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An index connection ID in an IndexResource attached to this agent.""" - index_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of an index in an IndexResource attached to this agent.""" - query_type: Optional[Union[str, "_models.AzureAISearchQueryType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Type of query in an AIIndexResource attached to this agent. Known values are: \"simple\", - \"semantic\", \"vector\", \"vector_simple_hybrid\", and \"vector_semantic_hybrid\".""" - top_k: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of documents to retrieve from search and present to the model.""" - filter: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """filter string for search resource. `Learn more here - `_.""" - index_asset_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Index asset id for search resource.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Evaluator name. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Evaluator version. If not specified, the latest version is used.""" @overload def __init__( self, *, - project_connection_id: Optional[str] = None, - index_name: Optional[str] = None, - query_type: Optional[Union[str, "_models.AzureAISearchQueryType"]] = None, - top_k: Optional[int] = None, - filter: Optional[str] = None, # pylint: disable=redefined-builtin - index_asset_id: Optional[str] = None, + name: str, + version: Optional[str] = None, ) -> None: ... @overload @@ -1491,50 +1543,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ApiError(_Model): - """ApiError. +class AgentOptimizationInlineDatasetInput(AgentOptimizationDatasetInput, discriminator="inline"): + """Inline dataset — items supplied directly in the request body. - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar param: - :vartype param: str - :ivar type: - :vartype type: str - :ivar details: - :vartype details: list[~azure.ai.projects.models.ApiError] - :ivar additional_info: - :vartype additional_info: dict[str, any] - :ivar debug_info: - :vartype debug_info: dict[str, any] + :ivar type: Dataset input type discriminator. Required. Inline dataset — items are provided + directly in the request body. + :vartype type: str or ~azure.ai.projects.models.INLINE + :ivar dataset_items: Dataset items. Required. + :vartype dataset_items: list[~azure.ai.projects.models.AgentOptimizationDatasetItem] """ - code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - details: Optional[list["_models.ApiError"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - additional_info: Optional[dict[str, Any]] = rest_field( - name="additionalInfo", visibility=["read", "create", "update", "delete", "query"] - ) - debug_info: Optional[dict[str, Any]] = rest_field( - name="debugInfo", visibility=["read", "create", "update", "delete", "query"] + type: Literal[AgentOptimizationDatasetInputType.INLINE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset input type discriminator. Required. Inline dataset — items are provided directly in the + request body.""" + dataset_items: list["_models.AgentOptimizationDatasetItem"] = rest_field( + name="items", visibility=["read", "create", "update", "delete", "query"] ) + """Dataset items. Required.""" @overload def __init__( self, *, - code: str, - message: str, - param: Optional[str] = None, - type: Optional[str] = None, - details: Optional[list["_models.ApiError"]] = None, - additional_info: Optional[dict[str, Any]] = None, - debug_info: Optional[dict[str, Any]] = None, + dataset_items: list["_models.AgentOptimizationDatasetItem"], ) -> None: ... @overload @@ -1546,23 +1577,64 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = AgentOptimizationDatasetInputType.INLINE # type: ignore -class ApiErrorResponse(_Model): - """Error response for API failures. +class AgentOptimizationJob(_Model): + """Agent optimization job resource — a long-running job that optimizes an agent's configuration + (instructions, model, skills, tools) to maximize evaluation scores. On success, the result + contains scored candidates. - :ivar error: Required. + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: ~azure.ai.projects.models.AgentOptimizationJobInputs + :ivar result: Result produced on success. + :vartype result: ~azure.ai.projects.models.AgentOptimizationJobResult + :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 created_at: The timestamp when the job was created, represented in Unix time. Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. + Required. + :vartype updated_at: ~datetime.datetime + :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known + progress. + :vartype progress: ~azure.ai.projects.models.AgentOptimizationJobProgress + :ivar warnings: Non-fatal warnings emitted at any point during optimization. + :vartype warnings: list[str] """ - error: "_models.ApiError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + id: str = rest_field(visibility=["read"]) + """Server-assigned unique identifier. Required.""" + inputs: Optional["_models.AgentOptimizationJobInputs"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Caller-supplied inputs.""" + result: Optional["_models.AgentOptimizationJobResult"] = rest_field(visibility=["read"]) + """Result produced on success.""" + status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) + """Error details — populated only on failure.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was created, represented in Unix time. Required.""" + updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was last updated, represented in Unix time. Required.""" + progress: Optional["_models.AgentOptimizationJobProgress"] = rest_field(visibility=["read"]) + """Progress snapshot. May be present in terminal states reflecting last-known progress.""" + warnings: Optional[list[str]] = rest_field(visibility=["read"]) + """Non-fatal warnings emitted at any point during optimization.""" @overload def __init__( self, *, - error: "_models.ApiError", + inputs: Optional["_models.AgentOptimizationJobInputs"] = None, ) -> None: ... @overload @@ -1576,23 +1648,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ApiKeyCredentials(BaseCredentials, discriminator="ApiKey"): - """API Key Credential definition. +class AgentOptimizationJobInputs(_Model): + """Caller-supplied inputs for an optimization job. - :ivar type: The credential type. Required. API Key credential. - :vartype type: str or ~azure.ai.projects.models.API_KEY - :ivar api_key: API Key. - :vartype api_key: str + :ivar agent: The agent (and pinned version) being optimized. Required. + :vartype agent: ~azure.ai.projects.models.OptimizedAgentIdentifier + :ivar train_dataset: Training dataset — either inline items or a reference to a registered + dataset. Required. Required. + :vartype train_dataset: ~azure.ai.projects.models.AgentOptimizationDatasetInput + :ivar validation_dataset: Optional held-out validation dataset for measuring generalization of + the final candidate. + :vartype validation_dataset: ~azure.ai.projects.models.AgentOptimizationDatasetInput + :ivar evaluators: Job-level evaluators referenced by name and optional version. Required; at + least one must be provided. Required. + :vartype evaluators: list[~azure.ai.projects.models.AgentOptimizationEvaluatorRef] + :ivar options: Tuning knobs and run-mode. + :vartype options: ~azure.ai.projects.models.AgentOptimizationOptions """ - type: Literal[CredentialType.API_KEY] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. API Key credential.""" - api_key: Optional[str] = rest_field(name="key", visibility=["read"]) - """API Key.""" + agent: "_models.OptimizedAgentIdentifier" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent (and pinned version) being optimized. Required.""" + train_dataset: "_models.AgentOptimizationDatasetInput" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Training dataset — either inline items or a reference to a registered dataset. Required. + Required.""" + validation_dataset: Optional["_models.AgentOptimizationDatasetInput"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional held-out validation dataset for measuring generalization of the final candidate.""" + evaluators: list["_models.AgentOptimizationEvaluatorRef"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Job-level evaluators referenced by name and optional version. Required; at least one must be + provided. Required.""" + options: Optional["_models.AgentOptimizationOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Tuning knobs and run-mode.""" @overload def __init__( self, + *, + agent: "_models.OptimizedAgentIdentifier", + train_dataset: "_models.AgentOptimizationDatasetInput", + evaluators: list["_models.AgentOptimizationEvaluatorRef"], + validation_dataset: Optional["_models.AgentOptimizationDatasetInput"] = None, + options: Optional["_models.AgentOptimizationOptions"] = None, ) -> None: ... @overload @@ -1604,68 +1707,74 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.API_KEY # type: ignore -class ApplyPatchToolParam(Tool, discriminator="apply_patch"): - """Apply patch tool. +class AgentOptimizationJobListItem(_Model): + """Slim job representation returned by the LIST endpoint. - :ivar type: The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH. - :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :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 created_at: The timestamp when the job was created, represented in Unix time. Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. + Required. + :vartype updated_at: ~datetime.datetime + :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known + progress. + :vartype progress: ~azure.ai.projects.models.AgentOptimizationJobProgress + :ivar agent: The agent targeted by this optimization job. + :vartype agent: ~azure.ai.projects.models.OptimizedAgentIdentifier """ - 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.""" - - @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.APPLY_PATCH # type: ignore + id: str = rest_field(visibility=["read"]) + """Server-assigned unique identifier. Required.""" + status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) + """Error details — populated only on failure.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was created, represented in Unix time. Required.""" + updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was last updated, represented in Unix time. Required.""" + progress: Optional["_models.AgentOptimizationJobProgress"] = rest_field(visibility=["read"]) + """Progress snapshot. May be present in terminal states reflecting last-known progress.""" + agent: Optional["_models.OptimizedAgentIdentifier"] = rest_field(visibility=["read"]) + """The agent targeted by this optimization job.""" -class ApproximateLocation(_Model): - """ApproximateLocation. +class AgentOptimizationJobProgress(_Model): + """In-flight progress; only populated while status is queued or in_progress. - :ivar type: The type of location approximation. Always ``approximate``. Required. Default value - is "approximate". - :vartype type: str - :ivar country: - :vartype country: str - :ivar region: - :vartype region: str - :ivar city: - :vartype city: str - :ivar timezone: - :vartype timezone: str + :ivar candidates_completed: Number of candidates whose evaluation has completed so far. + Required. + :vartype candidates_completed: int + :ivar best_score: Best score observed so far across all candidates. Required. + :vartype best_score: float + :ivar elapsed_seconds: Wall-clock time elapsed in seconds since the job began executing. + Required. + :vartype elapsed_seconds: float """ - type: Literal["approximate"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of location approximation. Always ``approximate``. Required. Default value is - \"approximate\".""" - country: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - region: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - city: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - timezone: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + candidates_completed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of candidates whose evaluation has completed so far. Required.""" + best_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Best score observed so far across all candidates. Required.""" + elapsed_seconds: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Wall-clock time elapsed in seconds since the job began executing. Required.""" @overload def __init__( self, *, - country: Optional[str] = None, - region: Optional[str] = None, - city: Optional[str] = None, - timezone: Optional[str] = None, + candidates_completed: int, + best_score: float, + elapsed_seconds: float, ) -> None: ... @overload @@ -1677,35 +1786,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["approximate"] = "approximate" -class ArtifactProfile(_Model): - """Artifact profile of the model. +class AgentOptimizationJobResult(_Model): + """Terminal-state result body. Populated when status is succeeded or failed. - :ivar category: The category of the artifact profile. Required. Known values are: "DataOnly", - "RuntimeDependent", and "Unknown". - :vartype category: str or ~azure.ai.projects.models.FoundryModelArtifactProfileCategory - :ivar signals: Signals detected in the model artifact. - :vartype signals: list[str or ~azure.ai.projects.models.FoundryModelArtifactProfileSignal] + :ivar baseline: Candidate ID of the original (un-optimized) baseline evaluation. + :vartype baseline: str + :ivar best: Candidate ID of the highest-scoring candidate found during optimization. + :vartype best: str + :ivar candidates: All evaluated candidates including baseline. + :vartype candidates: list[~azure.ai.projects.models.AgentOptimizationCandidate] """ - category: Union[str, "_models.FoundryModelArtifactProfileCategory"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The category of the artifact profile. Required. Known values are: \"DataOnly\", - \"RuntimeDependent\", and \"Unknown\".""" - signals: Optional[list[Union[str, "_models.FoundryModelArtifactProfileSignal"]]] = rest_field( + baseline: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Candidate ID of the original (un-optimized) baseline evaluation.""" + best: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Candidate ID of the highest-scoring candidate found during optimization.""" + candidates: Optional[list["_models.AgentOptimizationCandidate"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Signals detected in the model artifact.""" + """All evaluated candidates including baseline.""" @overload def __init__( self, *, - category: Union[str, "_models.FoundryModelArtifactProfileCategory"], - signals: Optional[list[Union[str, "_models.FoundryModelArtifactProfileSignal"]]] = None, + baseline: Optional[str] = None, + best: Optional[str] = None, + candidates: Optional[list["_models.AgentOptimizationCandidate"]] = None, ) -> None: ... @overload @@ -1719,38 +1828,71 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AutoCodeInterpreterToolParam(_Model): - """Automatic Code Interpreter Tool Parameters. +class AgentOptimizationOptions(_Model): + """Tuning knobs and run-mode for an optimization job. - :ivar type: Always ``auto``. Required. Default value is "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 network_policy: - :vartype network_policy: ~azure.ai.projects.models.ContainerNetworkPolicyParam + :ivar max_candidates: Maximum number of optimization candidates to generate. Must be >= 1. + Default: 5. + :vartype max_candidates: int + :ivar optimization_config: Per-target-attribute configuration overrides. Contains skills, + tools, system_prompt for the agent, plus model space for model optimization. + :vartype optimization_config: dict[str, any] + :ivar eval_model: Model deployment used for evaluation. Defaults to server config (typically + 'gpt-4o'). + :vartype eval_model: str + :ivar optimization_model: Model deployment for optimization reasoning (must be gpt-5 family). + Falls back to the default eval model when not set. + :vartype optimization_model: str + :ivar evaluation_level: Evaluation granularity. Null/omitted means per-item single-turn. Set to + 'conversation' for per-conversation multi-turn simulation scoring. Known values are: "turn" and + "conversation". + :vartype evaluation_level: str or ~azure.ai.projects.models.EvaluationLevel + :ivar max_stalls: Maximum number of consecutive reflective minibatch rejections before stopping + early. A 'stall' occurs when the optimizer proposes a prompt change, evaluates it on a small + subset, and the score does not improve — so no full validation-set evaluation is triggered. The + counter resets whenever a minibatch passes and its full-validation score beats the current + best. Only a sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the + stop. The service defaults to 5 if a value is not specified by the caller. Must be >= 1 when + set. + :vartype max_stalls: int """ - type: Literal["auto"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Always ``auto``. Required. Default value is \"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( + max_candidates: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of optimization candidates to generate. Must be >= 1. Default: 5.""" + optimization_config: Optional[dict[str, Any]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" - network_policy: Optional["_models.ContainerNetworkPolicyParam"] = rest_field( + """Per-target-attribute configuration overrides. Contains skills, tools, system_prompt for the + agent, plus model space for model optimization.""" + eval_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Model deployment used for evaluation. Defaults to server config (typically 'gpt-4o').""" + optimization_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Model deployment for optimization reasoning (must be gpt-5 family). Falls back to the default + eval model when not set.""" + evaluation_level: Optional[Union[str, "_models.EvaluationLevel"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) + """Evaluation granularity. Null/omitted means per-item single-turn. Set to 'conversation' for + per-conversation multi-turn simulation scoring. Known values are: \"turn\" and + \"conversation\".""" + max_stalls: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of consecutive reflective minibatch rejections before stopping early. A 'stall' + occurs when the optimizer proposes a prompt change, evaluates it on a small subset, and the + score does not improve — so no full validation-set evaluation is triggered. The counter resets + whenever a minibatch passes and its full-validation score beats the current best. Only a + sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the stop. The + service defaults to 5 if a value is not specified by the caller. Must be >= 1 when set.""" @overload def __init__( self, *, - file_ids: Optional[list[str]] = None, - memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = None, - network_policy: Optional["_models.ContainerNetworkPolicyParam"] = None, + max_candidates: Optional[int] = None, + optimization_config: Optional[dict[str, Any]] = None, + eval_model: Optional[str] = None, + optimization_model: Optional[str] = None, + evaluation_level: Optional[Union[str, "_models.EvaluationLevel"]] = None, + max_stalls: Optional[int] = None, ) -> None: ... @overload @@ -1762,28 +1904,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["auto"] = "auto" - -class EvaluationTarget(_Model): - """Base class for targets with discriminator support. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureAIAgentTarget, AzureAIModelTarget +class AgentOptimizationReferenceDatasetInput(AgentOptimizationDatasetInput, discriminator="reference"): + """Reference to a registered Foundry dataset. - :ivar type: The type of target. Required. Default value is None. - :vartype type: str + :ivar type: Dataset input type discriminator. Required. Reference to a registered Foundry + dataset by name and version. + :vartype type: str or ~azure.ai.projects.models.REFERENCE + :ivar name: Registered dataset name. Required. + :vartype name: str + :ivar version: Dataset version. If not specified, the latest version is used. + :vartype version: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of target. Required. Default value is None.""" + type: Literal[AgentOptimizationDatasetInputType.REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset input type discriminator. Required. Reference to a registered Foundry dataset by name + and version.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Registered dataset name. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Dataset version. If not specified, the latest version is used.""" @overload def __init__( self, *, - type: str, + name: str, + version: Optional[str] = None, ) -> None: ... @overload @@ -1795,45 +1943,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = AgentOptimizationDatasetInputType.REFERENCE # type: ignore -class AzureAIAgentTarget(EvaluationTarget, discriminator="azure_ai_agent"): - """Represents a target specifying an Azure AI agent. +class AgentSessionResource(_Model): + """An agent session providing a long-lived compute sandbox for hosted agent invocations. - :ivar type: The type of target, always ``azure_ai_agent``. Required. Default value is - "azure_ai_agent". - :vartype type: str - :ivar name: The unique identifier of the Azure AI agent. Required. - :vartype name: str - :ivar version: The version of the Azure AI agent. - :vartype version: str - :ivar tool_descriptions: The parameters used to control the sampling behavior of the agent - during text generation. - :vartype tool_descriptions: list[~azure.ai.projects.models.ToolDescription] - :ivar tools: - :vartype tools: list[~azure.ai.projects.models.Tool] + :ivar agent_session_id: The session identifier. Required. + :vartype agent_session_id: str + :ivar version_indicator: The version indicator determining which agent version backs this + session. Required. + :vartype version_indicator: ~azure.ai.projects.models.VersionIndicator + :ivar status: The current status of the session. Required. Known values are: "creating", + "active", "idle", "updating", "failed", "deleting", "deleted", and "expired". + :vartype status: str or ~azure.ai.projects.models.AgentSessionStatus + :ivar created_at: The Unix timestamp (in seconds) when the session was created. Required. + :vartype created_at: ~datetime.datetime + :ivar last_accessed_at: The Unix timestamp (in seconds) when the session was last accessed. + Required. + :vartype last_accessed_at: ~datetime.datetime + :ivar expires_at: The Unix timestamp (in seconds) when the session expires (rolling, 30 days + from last activity). Required. + :vartype expires_at: ~datetime.datetime """ - type: Literal["azure_ai_agent"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of target, always ``azure_ai_agent``. Required. Default value is \"azure_ai_agent\".""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the Azure AI agent. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version of the Azure AI agent.""" - tool_descriptions: Optional[list["_models.ToolDescription"]] = rest_field( + agent_session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The session identifier. Required.""" + version_indicator: "_models.VersionIndicator" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The parameters used to control the sampling behavior of the agent during text generation.""" - tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version indicator determining which agent version backs this session. Required.""" + status: Union[str, "_models.AgentSessionStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The current status of the session. Required. Known values are: \"creating\", \"active\", + \"idle\", \"updating\", \"failed\", \"deleting\", \"deleted\", and \"expired\".""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) when the session was created. Required.""" + last_accessed_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) when the session was last accessed. Required.""" + expires_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity). + Required.""" @overload def __init__( self, *, - name: str, - version: Optional[str] = None, - tool_descriptions: Optional[list["_models.ToolDescription"]] = None, - tools: Optional[list["_models.Tool"]] = None, + agent_session_id: str, + version_indicator: "_models.VersionIndicator", + status: Union[str, "_models.AgentSessionStatus"], ) -> None: ... @overload @@ -1845,37 +2004,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "azure_ai_agent" # type: ignore -class AzureAIModelTarget(EvaluationTarget, discriminator="azure_ai_model"): - """Represents a target specifying an Azure AI model for operations requiring model selection. +class EvaluationTaxonomyInput(_Model): + """Input configuration for the evaluation taxonomy. - :ivar type: The type of target, always ``azure_ai_model``. Required. Default value is - "azure_ai_model". - :vartype type: str - :ivar model: The unique identifier of the Azure AI model. - :vartype model: str - :ivar sampling_params: The parameters used to control the sampling behavior of the model during - text generation. - :vartype sampling_params: ~azure.ai.projects.models.ModelSamplingParams + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AgentTaxonomyInput + + :ivar type: Input type of the evaluation taxonomy. Required. Known values are: "agent" and + "policy". + :vartype type: str or ~azure.ai.projects.models.EvaluationTaxonomyInputType """ - type: Literal["azure_ai_model"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of target, always ``azure_ai_model``. Required. Default value is \"azure_ai_model\".""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the Azure AI model.""" - sampling_params: Optional["_models.ModelSamplingParams"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The parameters used to control the sampling behavior of the model during text generation.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Input type of the evaluation taxonomy. Required. Known values are: \"agent\" and \"policy\".""" @overload def __init__( self, *, - model: Optional[str] = None, - sampling_params: Optional["_models.ModelSamplingParams"] = None, + type: str, ) -> None: ... @overload @@ -1887,52 +2037,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "azure_ai_model" # type: ignore -class Index(_Model): - """Index resource Definition. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureAISearchIndex, CosmosDBIndex, ManagedAzureAISearchIndex +class AgentTaxonomyInput(EvaluationTaxonomyInput, discriminator="agent"): + """Input configuration for the evaluation taxonomy when the input type is agent. - :ivar type: Type of index. Required. Known values are: "AzureSearch", - "CosmosDBNoSqlVectorStore", and "ManagedAzureSearch". - :vartype type: str or ~azure.ai.projects.models.IndexType - :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: Input type of the evaluation taxonomy. Required. Agent. + :vartype type: str or ~azure.ai.projects.models.AGENT + :ivar target: Target configuration for the agent. Required. + :vartype target: ~azure.ai.projects.models.EvaluationTarget + :ivar risk_categories: List of risk categories to evaluate against. Required. + :vartype risk_categories: list[str or ~azure.ai.projects.models.RiskCategory] """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of index. Required. Known values are: \"AzureSearch\", \"CosmosDBNoSqlVectorStore\", and - \"ManagedAzureSearch\".""" - 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=["create", "update"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) - """Tag dictionary. Tags can be added, removed, and updated.""" + type: Literal[EvaluationTaxonomyInputType.AGENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Input type of the evaluation taxonomy. Required. Agent.""" + target: "_models.EvaluationTarget" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Target configuration for the agent. Required.""" + risk_categories: list[Union[str, "_models.RiskCategory"]] = rest_field( + name="riskCategories", visibility=["read", "create", "update", "delete", "query"] + ) + """List of risk categories to evaluate against. Required.""" @overload def __init__( self, *, - type: str, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + target: "_models.EvaluationTarget", + risk_categories: list[Union[str, "_models.RiskCategory"]], ) -> None: ... @overload @@ -1944,49 +2076,112 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = EvaluationTaxonomyInputType.AGENT # type: ignore -class AzureAISearchIndex(Index, discriminator="AzureSearch"): - """Azure AI Search Index Definition. +class AgentVersionDetails(_Model): + """AgentVersionDetails. - :ivar id: Asset ID, a unique identifier for the asset. + :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 object: The object type, which is always 'agent.version'. Required. AGENT_VERSION. + :vartype object: str or ~azure.ai.projects.models.AGENT_VERSION + :ivar id: The unique identifier of the agent version. Required. :vartype id: str - :ivar name: The name of the resource. Required. + :ivar name: The name of the agent. Name can be used to retrieve/update/delete the agent. + Required. :vartype name: str - :ivar version: The version of the resource. Required. + :ivar version: The version identifier of the agent. Agents are immutable and every update + creates a new version while keeping the name same. Required. :vartype version: str - :ivar description: The asset description text. + :ivar description: A human-readable description of the agent. :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. Azure search. - :vartype type: str or ~azure.ai.projects.models.AZURE_SEARCH - :ivar connection_name: Name of connection to Azure AI Search. Required. - :vartype connection_name: str - :ivar index_name: Name of index in Azure AI Search resource to attach. Required. - :vartype index_name: str - :ivar field_mapping: Field mapping configuration. - :vartype field_mapping: ~azure.ai.projects.models.FieldMapping + :ivar created_at: The Unix timestamp (seconds) when the agent was created. Required. + :vartype created_at: ~datetime.datetime + :ivar definition: Required. + :vartype definition: ~azure.ai.projects.models.AgentDefinition + :ivar draft: Whether this agent version is a draft (candidate) rather than a release. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Defaults to false. + :vartype draft: bool + :ivar status: The provisioning status of the agent version. Defaults to 'active' for non-hosted + agents. For hosted agents, reflects infrastructure readiness. Known values are: "creating", + "active", "failed", "deleting", and "deleted". + :vartype status: str or ~azure.ai.projects.models.AgentVersionStatus + :ivar instance_identity: The instance identity of the agent. + :vartype instance_identity: ~azure.ai.projects.models.AgentIdentity + :ivar blueprint: The blueprint for the agent. + :vartype blueprint: ~azure.ai.projects.models.AgentIdentity + :ivar blueprint_reference: The blueprint for the agent. + :vartype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference + :ivar agent_guid: The unique GUID identifier of the agent. + :vartype agent_guid: str """ - type: Literal[IndexType.AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of index. Required. Azure search.""" - connection_name: str = rest_field(name="connectionName", visibility=["create"]) - """Name of connection to Azure AI Search. Required.""" - index_name: str = rest_field(name="indexName", visibility=["create"]) - """Name of index in Azure AI Search resource to attach. Required.""" - field_mapping: Optional["_models.FieldMapping"] = rest_field(name="fieldMapping", visibility=["create"]) - """Field mapping configuration.""" + 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.""" + object: Literal[AgentObjectType.AGENT_VERSION] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The object type, which is always 'agent.version'. Required. AGENT_VERSION.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the agent version. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the agent. Name can be used to retrieve/update/delete the agent. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version identifier of the agent. Agents are immutable and every update creates a new + version while keeping the name same. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the agent.""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the agent was created. Required.""" + definition: "_models.AgentDefinition" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + draft: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this agent version is a draft (candidate) rather than a release. Draft versions are + recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to + false.""" + status: Optional[Union[str, "_models.AgentVersionStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For + hosted agents, reflects infrastructure readiness. Known values are: \"creating\", \"active\", + \"failed\", \"deleting\", and \"deleted\".""" + instance_identity: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) + """The instance identity of the agent.""" + blueprint: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) + """The blueprint for the agent.""" + blueprint_reference: Optional["_models.AgentBlueprintReference"] = rest_field(visibility=["read"]) + """The blueprint for the agent.""" + agent_guid: Optional[str] = rest_field(visibility=["read"]) + """The unique GUID identifier of the agent.""" @overload def __init__( self, *, - connection_name: str, - index_name: str, + metadata: dict[str, str], + object: Literal[AgentObjectType.AGENT_VERSION], + id: str, # pylint: disable=redefined-builtin + name: str, + version: str, + created_at: datetime.datetime, + definition: "_models.AgentDefinition", description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - field_mapping: Optional["_models.FieldMapping"] = None, + draft: Optional[bool] = None, + status: Optional[Union[str, "_models.AgentVersionStatus"]] = None, ) -> None: ... @overload @@ -1998,49 +2193,54 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = IndexType.AZURE_SEARCH # type: ignore -class AzureAISearchTool(Tool, discriminator="azure_ai_search"): - """The input definition information for an Azure AI search tool as used to configure an agent. +class AISearchIndexResource(_Model): + """A AI Search Index resource. - :ivar type: The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH. - :vartype type: str or ~azure.ai.projects.models.AZURE_AI_SEARCH - :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 azure_ai_search: The azure ai search index resource. Required. - :vartype azure_ai_search: ~azure.ai.projects.models.AzureAISearchToolResource + :ivar project_connection_id: An index connection ID in an IndexResource attached to this agent. + :vartype project_connection_id: str + :ivar index_name: The name of an index in an IndexResource attached to this agent. + :vartype index_name: str + :ivar query_type: Type of query in an AIIndexResource attached to this agent. Known values are: + "simple", "semantic", "vector", "vector_simple_hybrid", and "vector_semantic_hybrid". + :vartype query_type: str or ~azure.ai.projects.models.AzureAISearchQueryType + :ivar top_k: Number of documents to retrieve from search and present to the model. + :vartype top_k: int + :ivar filter: filter string for search resource. `Learn more here + `_. + :vartype filter: str + :ivar index_asset_id: Index asset id for search resource. + :vartype index_asset_id: str """ - type: Literal[ToolType.AZURE_AI_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH.""" - 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.""" - azure_ai_search: "_models.AzureAISearchToolResource" = rest_field( + project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An index connection ID in an IndexResource attached to this agent.""" + index_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of an index in an IndexResource attached to this agent.""" + query_type: Optional[Union[str, "_models.AzureAISearchQueryType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The azure ai search index resource. Required.""" + """Type of query in an AIIndexResource attached to this agent. Known values are: \"simple\", + \"semantic\", \"vector\", \"vector_simple_hybrid\", and \"vector_semantic_hybrid\".""" + top_k: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of documents to retrieve from search and present to the model.""" + filter: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """filter string for search resource. `Learn more here + `_.""" + index_asset_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Index asset id for search resource.""" @overload def __init__( self, *, - azure_ai_search: "_models.AzureAISearchToolResource", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + project_connection_id: Optional[str] = None, + index_name: Optional[str] = None, + query_type: Optional[Union[str, "_models.AzureAISearchQueryType"]] = None, + top_k: Optional[int] = None, + filter: Optional[str] = None, # pylint: disable=redefined-builtin + index_asset_id: Optional[str] = None, ) -> None: ... @overload @@ -2052,41 +2252,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.AZURE_AI_SEARCH # type: ignore -class AzureAISearchToolboxTool(ToolboxTool, discriminator="azure_ai_search"): - """An Azure AI Search tool stored in a toolbox. +class ApiError(_Model): + """ApiError. - :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. AZURE_AI_SEARCH. - :vartype type: str or ~azure.ai.projects.models.AZURE_AI_SEARCH - :ivar azure_ai_search: The azure ai search index resource. Required. - :vartype azure_ai_search: ~azure.ai.projects.models.AzureAISearchToolResource + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar param: + :vartype param: str + :ivar type: + :vartype type: str + :ivar details: + :vartype details: list[~azure.ai.projects.models.ApiError] + :ivar additional_info: + :vartype additional_info: dict[str, any] + :ivar debug_info: + :vartype debug_info: dict[str, any] """ - type: Literal[ToolboxToolType.AZURE_AI_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AZURE_AI_SEARCH.""" - azure_ai_search: "_models.AzureAISearchToolResource" = rest_field( - visibility=["read", "create", "update", "delete", "query"] + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + details: Optional[list["_models.ApiError"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + additional_info: Optional[dict[str, Any]] = rest_field( + name="additionalInfo", visibility=["read", "create", "update", "delete", "query"] + ) + debug_info: Optional[dict[str, Any]] = rest_field( + name="debugInfo", visibility=["read", "create", "update", "delete", "query"] ) - """The azure ai search index resource. Required.""" @overload def __init__( self, *, - azure_ai_search: "_models.AzureAISearchToolResource", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + code: str, + message: str, + param: Optional[str] = None, + type: Optional[str] = None, + details: Optional[list["_models.ApiError"]] = None, + additional_info: Optional[dict[str, Any]] = None, + debug_info: Optional[dict[str, Any]] = None, ) -> None: ... @overload @@ -2098,28 +2309,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.AZURE_AI_SEARCH # type: ignore -class AzureAISearchToolResource(_Model): - """A set of index resources used by the ``azure_ai_search`` tool. +class ApiErrorResponse(_Model): + """Error response for API failures. - :ivar indexes: The indices attached to this agent. There can be a maximum of 1 index resource - attached to the agent. Required. - :vartype indexes: list[~azure.ai.projects.models.AISearchIndexResource] + :ivar error: Required. + :vartype error: ~azure.ai.projects.models.ApiError """ - indexes: list["_models.AISearchIndexResource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The indices attached to this agent. There can be a maximum of 1 index resource attached to the - agent. Required.""" + error: "_models.ApiError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - indexes: list["_models.AISearchIndexResource"], + error: "_models.ApiError", ) -> None: ... @overload @@ -2133,29 +2339,23 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureFunctionBinding(_Model): - """The structure for keeping storage queue name and URI. +class ApiKeyCredentials(BaseCredentials, discriminator="ApiKey"): + """API Key Credential definition. - :ivar type: The type of binding, which is always 'storage_queue'. Required. Default value is - "storage_queue". - :vartype type: str - :ivar storage_queue: Storage queue. Required. - :vartype storage_queue: ~azure.ai.projects.models.AzureFunctionStorageQueue + :ivar type: The credential type. Required. API Key credential. + :vartype type: str or ~azure.ai.projects.models.API_KEY + :ivar api_key: API Key. + :vartype api_key: str """ - type: Literal["storage_queue"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of binding, which is always 'storage_queue'. Required. Default value is - \"storage_queue\".""" - storage_queue: "_models.AzureFunctionStorageQueue" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Storage queue. Required.""" + type: Literal[CredentialType.API_KEY] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. API Key credential.""" + api_key: Optional[str] = rest_field(name="key", visibility=["read"]) + """API Key.""" @overload def __init__( self, - *, - storage_queue: "_models.AzureFunctionStorageQueue", ) -> None: ... @overload @@ -2167,44 +2367,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["storage_queue"] = "storage_queue" + self.type = CredentialType.API_KEY # type: ignore -class AzureFunctionDefinition(_Model): - """The definition of Azure function. +class ApplyPatchToolParam(Tool, discriminator="apply_patch"): + """Apply patch tool. - :ivar function: The definition of azure function and its parameters. Required. - :vartype function: ~azure.ai.projects.models.AzureFunctionDefinitionFunction - :ivar input_binding: Input storage queue. The queue storage trigger runs a function as messages - are added to it. Required. - :vartype input_binding: ~azure.ai.projects.models.AzureFunctionBinding - :ivar output_binding: Output storage queue. The function writes output to this queue when the - input items are processed. Required. - :vartype output_binding: ~azure.ai.projects.models.AzureFunctionBinding + :ivar type: The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH. + :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH """ - function: "_models.AzureFunctionDefinitionFunction" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The definition of azure function and its parameters. Required.""" - input_binding: "_models.AzureFunctionBinding" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input storage queue. The queue storage trigger runs a function as messages are added to it. - Required.""" - output_binding: "_models.AzureFunctionBinding" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Output storage queue. The function writes output to this queue when the input items are - processed. Required.""" + 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.""" @overload def __init__( self, - *, - function: "_models.AzureFunctionDefinitionFunction", - input_binding: "_models.AzureFunctionBinding", - output_binding: "_models.AzureFunctionBinding", ) -> None: ... @overload @@ -2216,36 +2394,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.APPLY_PATCH # type: ignore -class AzureFunctionDefinitionFunction(_Model): - """AzureFunctionDefinitionFunction. +class ApproximateLocation(_Model): + """ApproximateLocation. - :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] + :ivar type: The type of location approximation. Always ``approximate``. Required. Default value + is "approximate". + :vartype type: str + :ivar country: + :vartype country: str + :ivar region: + :vartype region: str + :ivar city: + :vartype city: str + :ivar timezone: + :vartype timezone: str """ - 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.""" + type: Literal["approximate"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of location approximation. Always ``approximate``. Required. Default value is + \"approximate\".""" + country: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + region: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + city: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + timezone: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - name: str, - parameters: dict[str, Any], - description: Optional[str] = None, + country: Optional[str] = None, + region: Optional[str] = None, + city: Optional[str] = None, + timezone: Optional[str] = None, ) -> None: ... @overload @@ -2257,29 +2440,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["approximate"] = "approximate" -class AzureFunctionStorageQueue(_Model): - """The structure for keeping storage queue name and URI. - - :ivar queue_service_endpoint: URI to the Azure Storage Queue service allowing you to manipulate - a queue. Required. - :vartype queue_service_endpoint: str - :ivar queue_name: The name of an Azure function storage queue. Required. - :vartype queue_name: str +class ArtifactProfile(_Model): + """Artifact profile of the model. + + :ivar category: The category of the artifact profile. Required. Known values are: "DataOnly", + "RuntimeDependent", and "Unknown". + :vartype category: str or ~azure.ai.projects.models.FoundryModelArtifactProfileCategory + :ivar signals: Signals detected in the model artifact. + :vartype signals: list[str or ~azure.ai.projects.models.FoundryModelArtifactProfileSignal] """ - queue_service_endpoint: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """URI to the Azure Storage Queue service allowing you to manipulate a queue. Required.""" - queue_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of an Azure function storage queue. Required.""" + category: Union[str, "_models.FoundryModelArtifactProfileCategory"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The category of the artifact profile. Required. Known values are: \"DataOnly\", + \"RuntimeDependent\", and \"Unknown\".""" + signals: Optional[list[Union[str, "_models.FoundryModelArtifactProfileSignal"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Signals detected in the model artifact.""" @overload def __init__( self, *, - queue_service_endpoint: str, - queue_name: str, + category: Union[str, "_models.FoundryModelArtifactProfileCategory"], + signals: Optional[list[Union[str, "_models.FoundryModelArtifactProfileSignal"]]] = None, ) -> None: ... @overload @@ -2293,35 +2482,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureFunctionTool(Tool, discriminator="azure_function"): - """The input definition information for an Azure Function Tool, as used to configure an Agent. +class AutoCodeInterpreterToolParam(_Model): + """Automatic Code Interpreter Tool Parameters. - :ivar type: The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION. - :vartype type: str or ~azure.ai.projects.models.AZURE_FUNCTION - :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 azure_function: The Azure Function Tool definition. Required. - :vartype azure_function: ~azure.ai.projects.models.AzureFunctionDefinition + :ivar type: Always ``auto``. Required. Default value is "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 network_policy: + :vartype network_policy: ~azure.ai.projects.models.ContainerNetworkPolicyParam """ - type: Literal[ToolType.AZURE_FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + type: Literal["auto"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Always ``auto``. Required. Default value is \"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"] ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - azure_function: "_models.AzureFunctionDefinition" = rest_field( + """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" + network_policy: Optional["_models.ContainerNetworkPolicyParam"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The Azure Function Tool definition. Required.""" @overload def __init__( self, *, - azure_function: "_models.AzureFunctionDefinition", - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + file_ids: Optional[list[str]] = None, + memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = None, + network_policy: Optional["_models.ContainerNetworkPolicyParam"] = None, ) -> None: ... @overload @@ -2333,22 +2525,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.AZURE_FUNCTION # type: ignore + self.type: Literal["auto"] = "auto" -class RedTeamTargetConfig(_Model): - """Abstract class for target configuration. +class EvaluationTarget(_Model): + """Base class for targets with discriminator support. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureOpenAIModelConfiguration + AzureAIAgentTarget, AzureAIModelTarget - :ivar type: Type of the model configuration. Required. Default value is None. + :ivar type: The type of target. Required. Default value is None. :vartype type: str """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of the model configuration. Required. Default value is None.""" + """The type of target. Required. Default value is None.""" @overload def __init__( @@ -2368,31 +2560,43 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureOpenAIModelConfiguration(RedTeamTargetConfig, discriminator="AzureOpenAIModel"): - """Azure OpenAI model configuration. The API version would be selected by the service for querying - the model. +class AzureAIAgentTarget(EvaluationTarget, discriminator="azure_ai_agent"): + """Represents a target specifying an Azure AI agent. - :ivar type: Required. Default value is "AzureOpenAIModel". + :ivar type: The type of target, always ``azure_ai_agent``. Required. Default value is + "azure_ai_agent". :vartype type: str - :ivar model_deployment_name: Deployment name for AOAI model. Example: gpt-4o if in AIServices - or connection based ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). - Required. - :vartype model_deployment_name: str + :ivar name: The unique identifier of the Azure AI agent. Required. + :vartype name: str + :ivar version: The version of the Azure AI agent. + :vartype version: str + :ivar tool_descriptions: The parameters used to control the sampling behavior of the agent + during text generation. + :vartype tool_descriptions: list[~azure.ai.projects.models.ToolDescription] + :ivar tools: + :vartype tools: list[~azure.ai.projects.models.Tool] """ - type: Literal["AzureOpenAIModel"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"AzureOpenAIModel\".""" - model_deployment_name: str = rest_field( - name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] + type: Literal["azure_ai_agent"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of target, always ``azure_ai_agent``. Required. Default value is \"azure_ai_agent\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the Azure AI agent. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the Azure AI agent.""" + tool_descriptions: Optional[list["_models.ToolDescription"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based - ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). Required.""" + """The parameters used to control the sampling behavior of the agent during text generation.""" + tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - model_deployment_name: str, + name: str, + version: Optional[str] = None, + tool_descriptions: Optional[list["_models.ToolDescription"]] = None, + tools: Optional[list["_models.Tool"]] = None, ) -> None: ... @overload @@ -2404,51 +2608,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "AzureOpenAIModel" # type: ignore + self.type = "azure_ai_agent" # type: ignore -class BingCustomSearchConfiguration(_Model): - """A bing custom search configuration. +class AzureAIModelTarget(EvaluationTarget, discriminator="azure_ai_model"): + """Represents a target specifying an Azure AI model for operations requiring model selection. - :ivar project_connection_id: Project connection id for grounding with bing search. Required. - :vartype project_connection_id: str - :ivar instance_name: Name of the custom configuration instance given to config. Required. - :vartype instance_name: str - :ivar market: The market where the results come from. - :vartype market: str - :ivar set_lang: The language to use for user interface strings when calling Bing API. - :vartype set_lang: str - :ivar count: The number of search results to return in the bing api response. - :vartype count: int - :ivar freshness: Filter search results by a specific time range. See `accepted values here - `_. - :vartype freshness: str + :ivar type: The type of target, always ``azure_ai_model``. Required. Default value is + "azure_ai_model". + :vartype type: str + :ivar model: The unique identifier of the Azure AI model. + :vartype model: str + :ivar sampling_params: The parameters used to control the sampling behavior of the model during + text generation. + :vartype sampling_params: ~azure.ai.projects.models.ModelSamplingParams """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Project connection id for grounding with bing search. Required.""" - instance_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the custom configuration instance given to config. Required.""" - market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The market where the results come from.""" - set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The language to use for user interface strings when calling Bing API.""" - count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of search results to return in the bing api response.""" - freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Filter search results by a specific time range. See `accepted values here - `_.""" + type: Literal["azure_ai_model"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of target, always ``azure_ai_model``. Required. Default value is \"azure_ai_model\".""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the Azure AI model.""" + sampling_params: Optional["_models.ModelSamplingParams"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The parameters used to control the sampling behavior of the model during text generation.""" @overload def __init__( self, *, - project_connection_id: str, - instance_name: str, - market: Optional[str] = None, - set_lang: Optional[str] = None, - count: Optional[int] = None, - freshness: Optional[str] = None, + model: Optional[str] = None, + sampling_params: Optional["_models.ModelSamplingParams"] = None, ) -> None: ... @overload @@ -2460,31 +2650,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "azure_ai_model" # type: ignore -class BingCustomSearchPreviewTool(Tool, discriminator="bing_custom_search_preview"): - """The input definition information for a Bing custom search tool as used to configure an agent. +class Index(_Model): + """Index resource Definition. - :ivar type: The object type, which is always 'bing_custom_search_preview'. Required. - BING_CUSTOM_SEARCH_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.BING_CUSTOM_SEARCH_PREVIEW - :ivar bing_custom_search_preview: The bing custom search tool parameters. Required. - :vartype bing_custom_search_preview: ~azure.ai.projects.models.BingCustomSearchToolParameters + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureAISearchIndex, CosmosDBIndex, ManagedAzureAISearchIndex + + :ivar type: Type of index. Required. Known values are: "AzureSearch", + "CosmosDBNoSqlVectorStore", and "ManagedAzureSearch". + :vartype type: str or ~azure.ai.projects.models.IndexType + :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] """ - type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'bing_custom_search_preview'. Required. - BING_CUSTOM_SEARCH_PREVIEW.""" - bing_custom_search_preview: "_models.BingCustomSearchToolParameters" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The bing custom search tool parameters. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Type of index. Required. Known values are: \"AzureSearch\", \"CosmosDBNoSqlVectorStore\", and + \"ManagedAzureSearch\".""" + 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=["create", "update"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) + """Tag dictionary. Tags can be added, removed, and updated.""" @overload def __init__( self, *, - bing_custom_search_preview: "_models.BingCustomSearchToolParameters", + type: str, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -2496,28 +2707,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.BING_CUSTOM_SEARCH_PREVIEW # type: ignore -class BingCustomSearchToolParameters(_Model): - """The bing custom search tool parameters. +class AzureAISearchIndex(Index, discriminator="AzureSearch"): + """Azure AI Search Index Definition. - :ivar search_configurations: The project connections attached to this tool. There can be a - maximum of 1 connection resource attached to the tool. Required. - :vartype search_configurations: list[~azure.ai.projects.models.BingCustomSearchConfiguration] + :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. Azure search. + :vartype type: str or ~azure.ai.projects.models.AZURE_SEARCH + :ivar connection_name: Name of connection to Azure AI Search. Required. + :vartype connection_name: str + :ivar index_name: Name of index in Azure AI Search resource to attach. Required. + :vartype index_name: str + :ivar field_mapping: Field mapping configuration. + :vartype field_mapping: ~azure.ai.projects.models.FieldMapping """ - search_configurations: list["_models.BingCustomSearchConfiguration"] = 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. Required.""" + type: Literal[IndexType.AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of index. Required. Azure search.""" + connection_name: str = rest_field(name="connectionName", visibility=["create"]) + """Name of connection to Azure AI Search. Required.""" + index_name: str = rest_field(name="indexName", visibility=["create"]) + """Name of index in Azure AI Search resource to attach. Required.""" + field_mapping: Optional["_models.FieldMapping"] = rest_field(name="fieldMapping", visibility=["create"]) + """Field mapping configuration.""" @overload def __init__( self, *, - search_configurations: list["_models.BingCustomSearchConfiguration"], + connection_name: str, + index_name: str, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + field_mapping: Optional["_models.FieldMapping"] = None, ) -> None: ... @overload @@ -2529,45 +2761,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = IndexType.AZURE_SEARCH # type: ignore -class BingGroundingSearchConfiguration(_Model): - """Search configuration for Bing Grounding. +class AzureAISearchTool(Tool, discriminator="azure_ai_search"): + """The input definition information for an Azure AI search tool as used to configure an agent. - :ivar project_connection_id: Project connection id for grounding with bing search. Required. - :vartype project_connection_id: str - :ivar market: The market where the results come from. - :vartype market: str - :ivar set_lang: The language to use for user interface strings when calling Bing API. - :vartype set_lang: str - :ivar count: The number of search results to return in the bing api response. - :vartype count: int - :ivar freshness: Filter search results by a specific time range. See `accepted values here - `_. - :vartype freshness: str + :ivar type: The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH. + :vartype type: str or ~azure.ai.projects.models.AZURE_AI_SEARCH + :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 azure_ai_search: The azure ai search index resource. Required. + :vartype azure_ai_search: ~azure.ai.projects.models.AzureAISearchToolResource """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Project connection id for grounding with bing search. Required.""" - market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The market where the results come from.""" - set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The language to use for user interface strings when calling Bing API.""" - count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of search results to return in the bing api response.""" - freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Filter search results by a specific time range. See `accepted values here - `_.""" + type: Literal[ToolType.AZURE_AI_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH.""" + 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.""" + azure_ai_search: "_models.AzureAISearchToolResource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The azure ai search index resource. Required.""" @overload def __init__( self, *, - project_connection_id: str, - market: Optional[str] = None, - set_lang: Optional[str] = None, - count: Optional[int] = None, - freshness: Optional[str] = None, + azure_ai_search: "_models.AzureAISearchToolResource", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -2579,28 +2815,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.AZURE_AI_SEARCH # type: ignore -class BingGroundingSearchToolParameters(_Model): - """The bing grounding search tool parameters. +class AzureAISearchToolboxTool(ToolboxTool, discriminator="azure_ai_search"): + """An Azure AI Search tool stored in a toolbox. - :ivar search_configurations: The search configurations attached to this tool. There can be a - maximum of 1 search configuration resource attached to the tool. Required. - :vartype search_configurations: - list[~azure.ai.projects.models.BingGroundingSearchConfiguration] + :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. AZURE_AI_SEARCH. + :vartype type: str or ~azure.ai.projects.models.AZURE_AI_SEARCH + :ivar azure_ai_search: The azure ai search index resource. Required. + :vartype azure_ai_search: ~azure.ai.projects.models.AzureAISearchToolResource """ - search_configurations: list["_models.BingGroundingSearchConfiguration"] = rest_field( + type: Literal[ToolboxToolType.AZURE_AI_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AZURE_AI_SEARCH.""" + azure_ai_search: "_models.AzureAISearchToolResource" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The search configurations attached to this tool. There can be a maximum of 1 search - configuration resource attached to the tool. Required.""" + """The azure ai search index resource. Required.""" @overload def __init__( self, *, - search_configurations: list["_models.BingGroundingSearchConfiguration"], + azure_ai_search: "_models.AzureAISearchToolResource", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -2612,49 +2861,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolboxToolType.AZURE_AI_SEARCH # type: ignore -class BingGroundingTool(Tool, discriminator="bing_grounding"): - """The input definition information for a bing grounding search tool as used to configure an - agent. +class AzureAISearchToolResource(_Model): + """A set of index resources used by the ``azure_ai_search`` tool. - :ivar type: The object type, which is always 'bing_grounding'. Required. BING_GROUNDING. - :vartype type: str or ~azure.ai.projects.models.BING_GROUNDING - :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 bing_grounding: The bing grounding search tool parameters. Required. - :vartype bing_grounding: ~azure.ai.projects.models.BingGroundingSearchToolParameters + :ivar indexes: The indices attached to this agent. There can be a maximum of 1 index resource + attached to the agent. Required. + :vartype indexes: list[~azure.ai.projects.models.AISearchIndexResource] """ - type: Literal[ToolType.BING_GROUNDING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'bing_grounding'. Required. BING_GROUNDING.""" - 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.""" - bing_grounding: "_models.BingGroundingSearchToolParameters" = rest_field( + indexes: list["_models.AISearchIndexResource"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The bing grounding search tool parameters. Required.""" + """The indices attached to this agent. There can be a maximum of 1 index resource attached to the + agent. Required.""" @overload def __init__( self, *, - bing_grounding: "_models.BingGroundingSearchToolParameters", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + indexes: list["_models.AISearchIndexResource"], ) -> None: ... @overload @@ -2666,40 +2894,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.BING_GROUNDING # type: ignore -class BlobReference(_Model): - """Blob reference details. +class AzureFunctionBinding(_Model): + """The structure for keeping storage queue name and URI. - :ivar blob_uri: Blob URI path for client to upload data. Example: - ``https://blob.windows.core.net/Container/Path``. Required. - :vartype blob_uri: str - :ivar storage_account_arm_id: ARM ID of the storage account to use. Required. - :vartype storage_account_arm_id: str - :ivar credential: Credential info to access the storage account. Required. - :vartype credential: ~azure.ai.projects.models.BlobReferenceSasCredential + :ivar type: The type of binding, which is always 'storage_queue'. Required. Default value is + "storage_queue". + :vartype type: str + :ivar storage_queue: Storage queue. Required. + :vartype storage_queue: ~azure.ai.projects.models.AzureFunctionStorageQueue """ - blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) - """Blob URI path for client to upload data. Example: - ``https://blob.windows.core.net/Container/Path``. Required.""" - storage_account_arm_id: str = rest_field( - name="storageAccountArmId", visibility=["read", "create", "update", "delete", "query"] - ) - """ARM ID of the storage account to use. Required.""" - credential: "_models.BlobReferenceSasCredential" = rest_field( + type: Literal["storage_queue"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of binding, which is always 'storage_queue'. Required. Default value is + \"storage_queue\".""" + storage_queue: "_models.AzureFunctionStorageQueue" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Credential info to access the storage account. Required.""" + """Storage queue. Required.""" @overload def __init__( self, *, - blob_uri: str, - storage_account_arm_id: str, - credential: "_models.BlobReferenceSasCredential", + storage_queue: "_models.AzureFunctionStorageQueue", ) -> None: ... @overload @@ -2711,40 +2930,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["storage_queue"] = "storage_queue" -class BlobReferenceSasCredential(_Model): - """SAS Credential definition. - - :ivar sas_uri: SAS uri. Required. - :vartype sas_uri: str - :ivar type: Type of credential. Required. Default value is "SAS". - :vartype type: str - """ - - sas_uri: str = rest_field(name="sasUri", visibility=["read"]) - """SAS uri. Required.""" - type: Literal["SAS"] = rest_field(visibility=["read"]) - """Type of credential. Required. Default value is \"SAS\".""" - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type: Literal["SAS"] = "SAS" - - -class BotServiceAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotService"): - """BotServiceAuthorizationScheme. +class AzureFunctionDefinition(_Model): + """The definition of Azure function. - :ivar type: Required. BOT_SERVICE. - :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE + :ivar function: The definition of azure function and its parameters. Required. + :vartype function: ~azure.ai.projects.models.AzureFunctionDefinitionFunction + :ivar input_binding: Input storage queue. The queue storage trigger runs a function as messages + are added to it. Required. + :vartype input_binding: ~azure.ai.projects.models.AzureFunctionBinding + :ivar output_binding: Output storage queue. The function writes output to this queue when the + input items are processed. Required. + :vartype output_binding: ~azure.ai.projects.models.AzureFunctionBinding """ - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. BOT_SERVICE.""" + function: "_models.AzureFunctionDefinitionFunction" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The definition of azure function and its parameters. Required.""" + input_binding: "_models.AzureFunctionBinding" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Input storage queue. The queue storage trigger runs a function as messages are added to it. + Required.""" + output_binding: "_models.AzureFunctionBinding" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Output storage queue. The function writes output to this queue when the input items are + processed. Required.""" @overload def __init__( self, + *, + function: "_models.AzureFunctionDefinitionFunction", + input_binding: "_models.AzureFunctionBinding", + output_binding: "_models.AzureFunctionBinding", ) -> None: ... @overload @@ -2756,22 +2979,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE # type: ignore - -class BotServiceRbacAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceRbac"): - """BotServiceRbacAuthorizationScheme. - - :ivar type: Required. BOT_SERVICE_RBAC. - :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE_RBAC - """ - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. BOT_SERVICE_RBAC.""" +class AzureFunctionDefinitionFunction(_Model): + """AzureFunctionDefinitionFunction. - @overload - def __init__( + :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] + """ + + 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, + *, + name: str, + parameters: dict[str, Any], + description: Optional[str] = None, ) -> None: ... @overload @@ -2783,22 +3020,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC # type: ignore -class BotServiceTenantAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceTenant"): - """BotServiceTenantAuthorizationScheme. +class AzureFunctionStorageQueue(_Model): + """The structure for keeping storage queue name and URI. - :ivar type: Required. BOT_SERVICE_TENANT. - :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE_TENANT + :ivar queue_service_endpoint: URI to the Azure Storage Queue service allowing you to manipulate + a queue. Required. + :vartype queue_service_endpoint: str + :ivar queue_name: The name of an Azure function storage queue. Required. + :vartype queue_name: str """ - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. BOT_SERVICE_TENANT.""" + queue_service_endpoint: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """URI to the Azure Storage Queue service allowing you to manipulate a queue. Required.""" + queue_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of an Azure function storage queue. Required.""" @overload def __init__( self, + *, + queue_service_endpoint: str, + queue_name: str, ) -> None: ... @overload @@ -2810,32 +3054,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT # type: ignore -class BrowserAutomationPreviewTool(Tool, discriminator="browser_automation_preview"): - """The input definition information for a Browser Automation Tool, as used to configure an Agent. +class AzureFunctionTool(Tool, discriminator="azure_function"): + """The input definition information for an Azure Function Tool, as used to configure an Agent. - :ivar type: The object type, which is always 'browser_automation_preview'. Required. - BROWSER_AUTOMATION_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.BROWSER_AUTOMATION_PREVIEW - :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. - :vartype browser_automation_preview: ~azure.ai.projects.models.BrowserAutomationToolParameters + :ivar type: The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION. + :vartype type: str or ~azure.ai.projects.models.AZURE_FUNCTION + :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 azure_function: The Azure Function Tool definition. Required. + :vartype azure_function: ~azure.ai.projects.models.AzureFunctionDefinition """ - type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'browser_automation_preview'. Required. - BROWSER_AUTOMATION_PREVIEW.""" - browser_automation_preview: "_models.BrowserAutomationToolParameters" = rest_field( + type: Literal[ToolType.AZURE_FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The Browser Automation Tool parameters. Required.""" + """Deprecated. This property is deprecated and will be removed in a future version.""" + azure_function: "_models.AzureFunctionDefinition" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Azure Function Tool definition. Required.""" @overload def __init__( self, *, - browser_automation_preview: "_models.BrowserAutomationToolParameters", + azure_function: "_models.AzureFunctionDefinition", + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -2847,41 +3096,66 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore + self.type = ToolType.AZURE_FUNCTION # type: ignore -class BrowserAutomationPreviewToolboxTool(ToolboxTool, discriminator="browser_automation_preview"): - """A browser automation tool stored in a toolbox. +class RedTeamTargetConfig(_Model): + """Abstract class for target configuration. - :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. BROWSER_AUTOMATION_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.BROWSER_AUTOMATION_PREVIEW - :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. - :vartype browser_automation_preview: ~azure.ai.projects.models.BrowserAutomationToolParameters + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureOpenAIModelConfiguration + + :ivar type: Type of the model configuration. Required. Default value is None. + :vartype type: str """ - type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. BROWSER_AUTOMATION_PREVIEW.""" - browser_automation_preview: "_models.BrowserAutomationToolParameters" = rest_field( - visibility=["read", "create", "update", "delete", "query"] + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Type of the model configuration. 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 AzureOpenAIModelConfiguration(RedTeamTargetConfig, discriminator="AzureOpenAIModel"): + """Azure OpenAI model configuration. The API version would be selected by the service for querying + the model. + + :ivar type: Required. Default value is "AzureOpenAIModel". + :vartype type: str + :ivar model_deployment_name: Deployment name for AOAI model. Example: gpt-4o if in AIServices + or connection based ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). + Required. + :vartype model_deployment_name: str + """ + + type: Literal["AzureOpenAIModel"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"AzureOpenAIModel\".""" + model_deployment_name: str = rest_field( + name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] ) - """The Browser Automation Tool parameters. Required.""" + """Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based + ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). Required.""" @overload def __init__( self, *, - browser_automation_preview: "_models.BrowserAutomationToolParameters", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + model_deployment_name: str, ) -> None: ... @overload @@ -2893,25 +3167,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore + self.type = "AzureOpenAIModel" # type: ignore -class BrowserAutomationToolConnectionParameters(_Model): # pylint: disable=name-too-long - """Definition of input parameters for the connection used by the Browser Automation Tool. +class BingCustomSearchConfiguration(_Model): + """A bing custom search configuration. - :ivar project_connection_id: The ID of the project connection to your Azure Playwright - resource. Required. + :ivar project_connection_id: Project connection id for grounding with bing search. Required. :vartype project_connection_id: str + :ivar instance_name: Name of the custom configuration instance given to config. Required. + :vartype instance_name: str + :ivar market: The market where the results come from. + :vartype market: str + :ivar set_lang: The language to use for user interface strings when calling Bing API. + :vartype set_lang: str + :ivar count: The number of search results to return in the bing api response. + :vartype count: int + :ivar freshness: Filter search results by a specific time range. See `accepted values here + `_. + :vartype freshness: str """ project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the project connection to your Azure Playwright resource. Required.""" + """Project connection id for grounding with bing search. Required.""" + instance_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the custom configuration instance given to config. Required.""" + market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The market where the results come from.""" + set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The language to use for user interface strings when calling Bing API.""" + count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of search results to return in the bing api response.""" + freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Filter search results by a specific time range. See `accepted values here + `_.""" @overload def __init__( self, *, project_connection_id: str, + instance_name: str, + market: Optional[str] = None, + set_lang: Optional[str] = None, + count: Optional[int] = None, + freshness: Optional[str] = None, ) -> None: ... @overload @@ -2925,24 +3225,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BrowserAutomationToolParameters(_Model): - """Definition of input parameters for the Browser Automation Tool. +class BingCustomSearchPreviewTool(Tool, discriminator="bing_custom_search_preview"): + """The input definition information for a Bing custom search tool as used to configure an agent. - :ivar connection: The project connection parameters associated with the Browser Automation - Tool. Required. - :vartype connection: ~azure.ai.projects.models.BrowserAutomationToolConnectionParameters + :ivar type: The object type, which is always 'bing_custom_search_preview'. Required. + BING_CUSTOM_SEARCH_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.BING_CUSTOM_SEARCH_PREVIEW + :ivar bing_custom_search_preview: The bing custom search tool parameters. Required. + :vartype bing_custom_search_preview: ~azure.ai.projects.models.BingCustomSearchToolParameters """ - connection: "_models.BrowserAutomationToolConnectionParameters" = rest_field( + type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'bing_custom_search_preview'. Required. + BING_CUSTOM_SEARCH_PREVIEW.""" + bing_custom_search_preview: "_models.BingCustomSearchToolParameters" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The project connection parameters associated with the Browser Automation Tool. Required.""" + """The bing custom search tool parameters. Required.""" @overload def __init__( self, *, - connection: "_models.BrowserAutomationToolConnectionParameters", + bing_custom_search_preview: "_models.BingCustomSearchToolParameters", ) -> None: ... @overload @@ -2954,50 +3259,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.BING_CUSTOM_SEARCH_PREVIEW # type: ignore -class CaptureStructuredOutputsTool(Tool, discriminator="capture_structured_outputs"): - """A tool for capturing structured outputs. +class BingCustomSearchToolParameters(_Model): + """The bing custom search tool parameters. - :ivar type: The type of the tool. Always ``capture_structured_outputs``. Required. - CAPTURE_STRUCTURED_OUTPUTS. - :vartype type: str or ~azure.ai.projects.models.CAPTURE_STRUCTURED_OUTPUTS - :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 outputs: The structured outputs to capture from the model. Required. - :vartype outputs: ~azure.ai.projects.models.StructuredOutputDefinition + :ivar search_configurations: The project connections attached to this tool. There can be a + maximum of 1 connection resource attached to the tool. Required. + :vartype search_configurations: list[~azure.ai.projects.models.BingCustomSearchConfiguration] """ - type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``capture_structured_outputs``. Required. - CAPTURE_STRUCTURED_OUTPUTS.""" - 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.""" - outputs: "_models.StructuredOutputDefinition" = rest_field( + search_configurations: list["_models.BingCustomSearchConfiguration"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The structured outputs to capture from the model. Required.""" + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool. Required.""" @overload def __init__( self, *, - outputs: "_models.StructuredOutputDefinition", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + search_configurations: list["_models.BingCustomSearchConfiguration"], ) -> None: ... @overload @@ -3009,34 +3292,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.CAPTURE_STRUCTURED_OUTPUTS # type: ignore - -class ChartCoordinate(_Model): - """Coordinates for the analysis chart. - :ivar x: X-axis coordinate. Required. - :vartype x: int - :ivar y: Y-axis coordinate. Required. - :vartype y: int - :ivar size: Size of the chart element. Required. - :vartype size: int +class BingGroundingSearchConfiguration(_Model): + """Search configuration for Bing Grounding. + + :ivar project_connection_id: Project connection id for grounding with bing search. Required. + :vartype project_connection_id: str + :ivar market: The market where the results come from. + :vartype market: str + :ivar set_lang: The language to use for user interface strings when calling Bing API. + :vartype set_lang: str + :ivar count: The number of search results to return in the bing api response. + :vartype count: int + :ivar freshness: Filter search results by a specific time range. See `accepted values here + `_. + :vartype freshness: str """ - x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """X-axis coordinate. Required.""" - y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Y-axis coordinate. Required.""" - size: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Size of the chart element. Required.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Project connection id for grounding with bing search. Required.""" + market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The market where the results come from.""" + set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The language to use for user interface strings when calling Bing API.""" + count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of search results to return in the bing api response.""" + freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Filter search results by a specific time range. See `accepted values here + `_.""" @overload def __init__( self, *, - x: int, - y: int, - size: int, + project_connection_id: str, + market: Optional[str] = None, + set_lang: Optional[str] = None, + count: Optional[int] = None, + freshness: Optional[str] = None, ) -> None: ... @overload @@ -3050,50 +3344,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryItem(_Model): - """A single memory item stored in the memory store, containing content and metadata. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ChatSummaryMemoryItem, ProceduralMemoryItem, UserProfileMemoryItem +class BingGroundingSearchToolParameters(_Model): + """The bing grounding search tool parameters. - :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. Known values are: "user_profile", - "chat_summary", and "procedural". - :vartype kind: str or ~azure.ai.projects.models.MemoryItemKind + :ivar search_configurations: The search configurations attached to this tool. There can be a + maximum of 1 search configuration resource attached to the tool. Required. + :vartype search_configurations: + list[~azure.ai.projects.models.BingGroundingSearchConfiguration] """ - __mapping__: dict[str, _Model] = {} - memory_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the memory item. Required.""" - updated_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + search_configurations: list["_models.BingGroundingSearchConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The last update time of the memory item. Required.""" - scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The namespace that logically groups and isolates memories, such as a user ID. Required.""" - content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The content of the memory. Required.""" - kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) - """The kind of the memory item. Required. Known values are: \"user_profile\", \"chat_summary\", - and \"procedural\".""" + """The search configurations attached to this tool. There can be a maximum of 1 search + configuration resource attached to the tool. Required.""" @overload def __init__( self, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, - kind: str, + search_configurations: list["_models.BingGroundingSearchConfiguration"], ) -> None: ... @overload @@ -3107,33 +3377,47 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ChatSummaryMemoryItem(MemoryItem, discriminator="chat_summary"): - """A memory item containing a summary extracted from conversations. +class BingGroundingTool(Tool, discriminator="bing_grounding"): + """The input definition information for a bing grounding search tool as used to configure an + agent. - :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. Summary of chat conversations. - :vartype kind: str or ~azure.ai.projects.models.CHAT_SUMMARY + :ivar type: The object type, which is always 'bing_grounding'. Required. BING_GROUNDING. + :vartype type: str or ~azure.ai.projects.models.BING_GROUNDING + :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 bing_grounding: The bing grounding search tool parameters. Required. + :vartype bing_grounding: ~azure.ai.projects.models.BingGroundingSearchToolParameters """ - kind: Literal[MemoryItemKind.CHAT_SUMMARY] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The kind of the memory item. Required. Summary of chat conversations.""" + type: Literal[ToolType.BING_GROUNDING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'bing_grounding'. Required. BING_GROUNDING.""" + 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.""" + bing_grounding: "_models.BingGroundingSearchToolParameters" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The bing grounding search tool parameters. Required.""" @overload def __init__( self, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, + bing_grounding: "_models.BingGroundingSearchToolParameters", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -3145,73 +3429,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = MemoryItemKind.CHAT_SUMMARY # type: ignore - - -class ClusterInsightResult(_Model): - """Insights from the cluster analysis. - - :ivar summary: Summary of the insights report. Required. - :vartype summary: ~azure.ai.projects.models.InsightSummary - :ivar clusters: List of clusters identified in the insights. Required. - :vartype clusters: list[~azure.ai.projects.models.InsightCluster] - :ivar coordinates: Optional mapping of IDs to 2D coordinates used by the UX for - visualization. - - The map keys are string identifiers (for example, a cluster id or a sample id) - and the values are the coordinates and visual size for rendering on a 2D chart. - - This property is omitted unless the client requests coordinates (for example, - by passing ``includeCoordinates=true`` as a query parameter). - - Example: + self.type = ToolType.BING_GROUNDING # type: ignore - .. code-block:: - { - "cluster-1": { "x": 12, "y": 34, "size": 8 }, - "sample-123": { "x": 18, "y": 22, "size": 4 } - } +class BlobReference(_Model): + """Blob reference details. - Coordinates are intended only for client-side visualization and do not - modify the canonical insights results. - :vartype coordinates: dict[str, ~azure.ai.projects.models.ChartCoordinate] + :ivar blob_uri: Blob URI path for client to upload data. Example: + ``https://blob.windows.core.net/Container/Path``. Required. + :vartype blob_uri: str + :ivar storage_account_arm_id: ARM ID of the storage account to use. Required. + :vartype storage_account_arm_id: str + :ivar credential: Credential info to access the storage account. Required. + :vartype credential: ~azure.ai.projects.models.BlobReferenceSasCredential """ - summary: "_models.InsightSummary" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Summary of the insights report. Required.""" - clusters: list["_models.InsightCluster"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of clusters identified in the insights. Required.""" - coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = rest_field( + blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) + """Blob URI path for client to upload data. Example: + ``https://blob.windows.core.net/Container/Path``. Required.""" + storage_account_arm_id: str = rest_field( + name="storageAccountArmId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM ID of the storage account to use. Required.""" + credential: "_models.BlobReferenceSasCredential" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """ Optional mapping of IDs to 2D coordinates used by the UX for visualization. - - The map keys are string identifiers (for example, a cluster id or a sample id) - and the values are the coordinates and visual size for rendering on a 2D chart. - - This property is omitted unless the client requests coordinates (for example, - by passing ``includeCoordinates=true`` as a query parameter). - - Example: - - .. code-block:: - - { - \"cluster-1\": { \"x\": 12, \"y\": 34, \"size\": 8 }, - \"sample-123\": { \"x\": 18, \"y\": 22, \"size\": 4 } - } - - Coordinates are intended only for client-side visualization and do not - modify the canonical insights results.""" + """Credential info to access the storage account. Required.""" @overload def __init__( self, *, - summary: "_models.InsightSummary", - clusters: list["_models.InsightCluster"], - coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = None, + blob_uri: str, + storage_account_arm_id: str, + credential: "_models.BlobReferenceSasCredential", ) -> None: ... @overload @@ -3225,37 +3476,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ClusterTokenUsage(_Model): - """Token usage for cluster analysis. +class BlobReferenceSasCredential(_Model): + """SAS Credential definition. - :ivar input_token_usage: input token usage. Required. - :vartype input_token_usage: int - :ivar output_token_usage: output token usage. Required. - :vartype output_token_usage: int - :ivar total_token_usage: total token usage. Required. - :vartype total_token_usage: int + :ivar sas_uri: SAS uri. Required. + :vartype sas_uri: str + :ivar type: Type of credential. Required. Default value is "SAS". + :vartype type: str """ - input_token_usage: int = rest_field( - name="inputTokenUsage", visibility=["read", "create", "update", "delete", "query"] - ) - """input token usage. Required.""" - output_token_usage: int = rest_field( - name="outputTokenUsage", visibility=["read", "create", "update", "delete", "query"] - ) - """output token usage. Required.""" - total_token_usage: int = rest_field( - name="totalTokenUsage", visibility=["read", "create", "update", "delete", "query"] - ) - """total token usage. Required.""" + sas_uri: str = rest_field(name="sasUri", visibility=["read"]) + """SAS uri. Required.""" + type: Literal["SAS"] = rest_field(visibility=["read"]) + """Type of credential. Required. Default value is \"SAS\".""" - @overload - def __init__( - self, - *, - input_token_usage: int, - output_token_usage: int, - total_token_usage: int, + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["SAS"] = "SAS" + + +class BotServiceAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotService"): + """BotServiceAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE. + :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE + """ + + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. BOT_SERVICE.""" + + @overload + def __init__( + self, ) -> None: ... @overload @@ -3267,51 +3519,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE # type: ignore -class EvaluatorDefinition(_Model): - """Base evaluator configuration with discriminator. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CodeBasedEvaluatorDefinition, EndpointBasedEvaluatorDefinition, PromptBasedEvaluatorDefinition, - RubricBasedEvaluatorDefinition +class BotServiceRbacAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceRbac"): + """BotServiceRbacAuthorizationScheme. - :ivar type: The type of evaluator definition. Required. Known values are: "prompt", "code", - "prompt_and_code", "service", "openai_graders", "rubric", and "endpoint". - :vartype type: str or ~azure.ai.projects.models.EvaluatorDefinitionType - :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. BOT_SERVICE_RBAC. + :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE_RBAC """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of evaluator definition. Required. Known values are: \"prompt\", \"code\", - \"prompt_and_code\", \"service\", \"openai_graders\", \"rubric\", and \"endpoint\".""" - init_parameters: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters - like type, properties, required.""" - data_schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like - type, properties, required.""" - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """List of output metrics produced by this evaluator.""" + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. BOT_SERVICE_RBAC.""" @overload def __init__( self, - *, - type: str, - init_parameters: Optional[dict[str, Any]] = None, - data_schema: Optional[dict[str, Any]] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, ) -> None: ... @overload @@ -3323,55 +3546,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC # type: ignore -class CodeBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="code"): - """Code-based evaluator definition using python code. +class BotServiceTenantAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceTenant"): + """BotServiceTenantAuthorizationScheme. - :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. Code-based definition. - :vartype type: str or ~azure.ai.projects.models.CODE - :ivar code_text: Inline code text for the evaluator. - :vartype code_text: str - :ivar entry_point: The entry point Python file name for the uploaded evaluator code (e.g. - 'answer_length_evaluator.py'). - :vartype entry_point: str - :ivar image_tag: The container image tag to use for evaluator code execution. - :vartype image_tag: str - :ivar blob_uri: The blob URI for the evaluator storage. - :vartype blob_uri: str + :ivar type: Required. BOT_SERVICE_TENANT. + :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE_TENANT """ - type: Literal[EvaluatorDefinitionType.CODE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Code-based definition.""" - code_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Inline code text for the evaluator.""" - entry_point: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The entry point Python file name for the uploaded evaluator code (e.g. - 'answer_length_evaluator.py').""" - image_tag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The container image tag to use for evaluator code execution.""" - blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The blob URI for the evaluator storage.""" + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. BOT_SERVICE_TENANT.""" @overload def __init__( self, - *, - init_parameters: Optional[dict[str, Any]] = None, - data_schema: Optional[dict[str, Any]] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, - code_text: Optional[str] = None, - entry_point: Optional[str] = None, - image_tag: Optional[str] = None, - blob_uri: Optional[str] = None, ) -> None: ... @overload @@ -3383,53 +3573,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorDefinitionType.CODE # type: ignore + self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT # type: ignore -class CodeConfiguration(_Model): - """Code-based deployment configuration for a hosted agent. +class BrowserAutomationPreviewTool(Tool, discriminator="browser_automation_preview"): + """The input definition information for a Browser Automation Tool, as used to configure an Agent. - :ivar runtime: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', - 'python_3_13'). Required. - :vartype runtime: str - :ivar entry_point: The entry point command and arguments for the code execution. Required. - :vartype entry_point: list[str] - :ivar dependency_resolution: How package dependencies are resolved at deployment time. Defaults - to ``bundled``, where the caller bundles all dependencies into the uploaded zip and the service - performs no remote build. ``remote_build`` instructs the service to build dependencies remotely - from the manifest included in the uploaded zip. Required. Known values are: "bundled" and - "remote_build". - :vartype dependency_resolution: str or ~azure.ai.projects.models.CodeDependencyResolution - :ivar content_hash: The SHA-256 hex digest of the uploaded code zip. Set by the service from - the ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in - request payloads. - :vartype content_hash: str + :ivar type: The object type, which is always 'browser_automation_preview'. Required. + BROWSER_AUTOMATION_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.BROWSER_AUTOMATION_PREVIEW + :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. + :vartype browser_automation_preview: ~azure.ai.projects.models.BrowserAutomationToolParameters """ - runtime: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13'). - Required.""" - entry_point: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The entry point command and arguments for the code execution. Required.""" - dependency_resolution: Union[str, "_models.CodeDependencyResolution"] = rest_field( + type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'browser_automation_preview'. Required. + BROWSER_AUTOMATION_PREVIEW.""" + browser_automation_preview: "_models.BrowserAutomationToolParameters" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """How package dependencies are resolved at deployment time. Defaults to ``bundled``, where the - caller bundles all dependencies into the uploaded zip and the service performs no remote build. - ``remote_build`` instructs the service to build dependencies remotely from the manifest - included in the uploaded zip. Required. Known values are: \"bundled\" and \"remote_build\".""" - content_hash: Optional[str] = rest_field(visibility=["read"]) - """The SHA-256 hex digest of the uploaded code zip. Set by the service from the - ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in request - payloads.""" + """The Browser Automation Tool parameters. Required.""" @overload def __init__( self, *, - runtime: str, - entry_point: list[str], - dependency_resolution: Union[str, "_models.CodeDependencyResolution"], + browser_automation_preview: "_models.BrowserAutomationToolParameters", ) -> None: ... @overload @@ -3441,55 +3610,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore -class CodeInterpreterTool(Tool, discriminator="code_interpreter"): - """Code interpreter. +class BrowserAutomationPreviewToolboxTool(ToolboxTool, discriminator="browser_automation_preview"): + """A browser automation tool stored in a toolbox. - :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 name: Deprecated. This property is deprecated and will be removed in a future version. + :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. + :ivar description: Optional user-defined description for this tool or configuration. :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. + :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 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 type: Required. BROWSER_AUTOMATION_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.BROWSER_AUTOMATION_PREVIEW + :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. + :vartype browser_automation_preview: ~azure.ai.projects.models.BrowserAutomationToolParameters """ - 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.""" - 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( + type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. BROWSER_AUTOMATION_PREVIEW.""" + browser_automation_preview: "_models.BrowserAutomationToolParameters" = 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.""" + """The Browser Automation Tool parameters. Required.""" @overload def __init__( self, *, + browser_automation_preview: "_models.BrowserAutomationToolParameters", 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 @@ -3501,47 +3656,25 @@ 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 + self.type = ToolboxToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore -class CodeInterpreterToolboxTool(ToolboxTool, discriminator="code_interpreter"): - """A code interpreter tool stored in a toolbox. +class BrowserAutomationToolConnectionParameters(_Model): # pylint: disable=name-too-long + """Definition of input parameters for the connection used by the Browser Automation Tool. - :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. CODE_INTERPRETER. - :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER - :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 project_connection_id: The ID of the project connection to your Azure Playwright + resource. Required. + :vartype project_connection_id: str """ - type: Literal[ToolboxToolType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. CODE_INTERPRETER.""" - 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.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the project connection to your Azure Playwright resource. Required.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - container: Optional[Union[str, "_models.AutoCodeInterpreterToolParam"]] = None, + project_connection_id: str, ) -> None: ... @overload @@ -3553,63 +3686,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.CODE_INTERPRETER # type: ignore - -class ComparisonFilter(_Model): - """Comparison Filter. - :ivar type: Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, - ``lte``, ``in``, ``nin``. +class BrowserAutomationToolParameters(_Model): + """Definition of input parameters for the Browser Automation Tool. - * `eq`: equals - * `ne`: not equal - * `gt`: greater than - * `gte`: greater than or equal - * `lt`: less than - * `lte`: less than or equal - * `in`: in - * `nin`: not in. Required. Is one of the following types: Literal["eq"], Literal["ne"], - Literal["gt"], Literal["gte"], Literal["lt"], Literal["lte"], Literal["in"], Literal["nin"] - :vartype type: str or str or str or str or str or str or str or str - :ivar key: The key to compare against the value. Required. - :vartype key: str - :ivar value: The value to compare against the attribute key; supports string, number, or - boolean types. Required. Is one of the following types: str, float, bool, [Union[str, float]] - :vartype value: str or float or bool or list[str or float] + :ivar connection: The project connection parameters associated with the Browser Automation + Tool. Required. + :vartype connection: ~azure.ai.projects.models.BrowserAutomationToolConnectionParameters """ - type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, ``lte``, ``in``, - ``nin``. - - * `eq`: equals - * `ne`: not equal - * `gt`: greater than - * `gte`: greater than or equal - * `lt`: less than - * `lte`: less than or equal - * `in`: in - * `nin`: not in. Required. Is one of the following types: Literal[\"eq\"], - Literal[\"ne\"], Literal[\"gt\"], Literal[\"gte\"], Literal[\"lt\"], Literal[\"lte\"], - Literal[\"in\"], Literal[\"nin\"]""" - key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The key to compare against the value. Required.""" - value: Union[str, float, bool, list[Union[str, float]]] = rest_field( + connection: "_models.BrowserAutomationToolConnectionParameters" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The value to compare against the attribute key; supports string, number, or boolean types. - Required. Is one of the following types: str, float, bool, [Union[str, float]]""" + """The project connection parameters associated with the Browser Automation Tool. Required.""" @overload def __init__( self, *, - type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"], - key: str, - value: Union[str, float, bool, list[Union[str, float]]], + connection: "_models.BrowserAutomationToolConnectionParameters", ) -> None: ... @overload @@ -3623,31 +3719,48 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CompoundFilter(_Model): - """Compound Filter. +class CaptureStructuredOutputsTool(Tool, discriminator="capture_structured_outputs"): + """A tool for capturing structured outputs. - :ivar type: Type of operation: ``and`` or ``or``. Required. Is either a Literal["and"] type or - a Literal["or"] type. - :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] + :ivar type: The type of the tool. Always ``capture_structured_outputs``. Required. + CAPTURE_STRUCTURED_OUTPUTS. + :vartype type: str or ~azure.ai.projects.models.CAPTURE_STRUCTURED_OUTPUTS + :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 outputs: The structured outputs to capture from the model. Required. + :vartype outputs: ~azure.ai.projects.models.StructuredOutputDefinition """ - 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( + type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``capture_structured_outputs``. Required. + CAPTURE_STRUCTURED_OUTPUTS.""" + 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"] ) - """Array of filters to combine. Items can be ``ComparisonFilter`` or ``CompoundFilter``. Required.""" + """Deprecated. This property is deprecated and will be removed in a future version.""" + outputs: "_models.StructuredOutputDefinition" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The structured outputs to capture from the model. Required.""" @overload def __init__( self, *, - type: Literal["and", "or"], - filters: list[Union["_models.ComparisonFilter", Any]], + outputs: "_models.StructuredOutputDefinition", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -3659,21 +3772,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.CAPTURE_STRUCTURED_OUTPUTS # type: ignore -class ComputerTool(Tool, discriminator="computer"): - """Computer. +class ChartCoordinate(_Model): + """Coordinates for the analysis chart. - :ivar type: The type of the computer tool. Always ``computer``. Required. COMPUTER. - :vartype type: str or ~azure.ai.projects.models.COMPUTER + :ivar x: X-axis coordinate. Required. + :vartype x: int + :ivar y: Y-axis coordinate. Required. + :vartype y: int + :ivar size: Size of the chart element. Required. + :vartype size: int """ - 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.""" + x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """X-axis coordinate. Required.""" + y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Y-axis coordinate. Required.""" + size: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Size of the chart element. Required.""" @overload def __init__( self, + *, + x: int, + y: int, + size: int, ) -> None: ... @overload @@ -3685,44 +3811,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: 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"): - """Computer use preview. +class MemoryItem(_Model): + """A single memory item stored in the memory store, containing content and metadata. - :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 + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ChatSummaryMemoryItem, ProceduralMemoryItem, UserProfileMemoryItem + + :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. Known values are: "user_profile", + "chat_summary", and "procedural". + :vartype kind: str or ~azure.ai.projects.models.MemoryItemKind """ - 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"] + __mapping__: dict[str, _Model] = {} + memory_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the memory item. Required.""" + updated_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" ) - """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.""" + """The last update time of the memory item. Required.""" + scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The namespace that logically groups and isolates memories, such as a user ID. Required.""" + content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The content of the memory. Required.""" + kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) + """The kind of the memory item. Required. Known values are: \"user_profile\", \"chat_summary\", + and \"procedural\".""" @overload def __init__( self, *, - environment: Union[str, "_models.ComputerEnvironment"], - display_width: int, - display_height: int, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: str, + kind: str, ) -> None: ... @overload @@ -3734,69 +3868,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: 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. +class ChatSummaryMemoryItem(MemoryItem, discriminator="chat_summary"): + """A memory item containing a summary extracted from conversations. - :ivar name: The friendly name of the connection, provided by the user. Required. - :vartype name: str - :ivar id: A unique identifier for the connection, generated by the service. Required. - :vartype id: str - :ivar type: Category of the connection. Required. Known values are: "AzureOpenAI", "AzureBlob", - "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", "AppConfig", "AppInsights", - "CustomKeys", and "RemoteTool_Preview". - :vartype type: str or ~azure.ai.projects.models.ConnectionType - :ivar target: The connection URL to be used for this service. Required. - :vartype target: str - :ivar is_default: Whether the connection is tagged as the default connection of its type. + :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 is_default: bool - :ivar credentials: The credentials used by the connection. Required. - :vartype credentials: ~azure.ai.projects.models.BaseCredentials - :ivar metadata: Metadata of the connection. Required. - :vartype metadata: dict[str, str] - """ - - name: str = rest_field(visibility=["read"]) - """The friendly name of the connection, provided by the user. Required.""" - id: str = rest_field(visibility=["read"]) - """A unique identifier for the connection, generated by the service. Required.""" - type: Union[str, "_models.ConnectionType"] = rest_field(visibility=["read"]) - """Category of the connection. Required. Known values are: \"AzureOpenAI\", \"AzureBlob\", - \"AzureStorageAccount\", \"CognitiveSearch\", \"CosmosDB\", \"ApiKey\", \"AppConfig\", - \"AppInsights\", \"CustomKeys\", and \"RemoteTool_Preview\".""" - target: str = rest_field(visibility=["read"]) - """The connection URL to be used for this service. Required.""" - is_default: bool = rest_field(name="isDefault", visibility=["read"]) - """Whether the connection is tagged as the default connection of its type. Required.""" - credentials: "_models.BaseCredentials" = rest_field(visibility=["read"]) - """The credentials used by the connection. Required.""" - metadata: dict[str, str] = rest_field(visibility=["read"]) - """Metadata of the connection. Required.""" - - -class FunctionShellToolParamEnvironment(_Model): - """FunctionShellToolParamEnvironment. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ContainerAutoParam, FunctionShellToolParamEnvironmentContainerReferenceParam, - FunctionShellToolParamEnvironmentLocalEnvironmentParam - - :ivar type: Required. Known values are: "container_auto", "local", and "container_reference". - :vartype type: str or ~azure.ai.projects.models.FunctionShellToolParamEnvironmentType + :vartype scope: str + :ivar content: The content of the memory. Required. + :vartype content: str + :ivar kind: The kind of the memory item. Required. Summary of chat conversations. + :vartype kind: str or ~azure.ai.projects.models.CHAT_SUMMARY """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"container_auto\", \"local\", and \"container_reference\".""" + kind: Literal[MemoryItemKind.CHAT_SUMMARY] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The kind of the memory item. Required. Summary of chat conversations.""" @overload def __init__( self, *, - type: str, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: str, ) -> None: ... @overload @@ -3808,47 +3908,73 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.kind = MemoryItemKind.CHAT_SUMMARY # type: ignore -class ContainerAutoParam(FunctionShellToolParamEnvironment, discriminator="container_auto"): - """ContainerAutoParam. +class ClusterInsightResult(_Model): + """Insights from the cluster analysis. - :ivar type: Automatically creates a container for this request. Required. CONTAINER_AUTO. - :vartype type: str or ~azure.ai.projects.models.CONTAINER_AUTO - :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: - :vartype network_policy: ~azure.ai.projects.models.ContainerNetworkPolicyParam + :ivar summary: Summary of the insights report. Required. + :vartype summary: ~azure.ai.projects.models.InsightSummary + :ivar clusters: List of clusters identified in the insights. Required. + :vartype clusters: list[~azure.ai.projects.models.InsightCluster] + :ivar coordinates: Optional mapping of IDs to 2D coordinates used by the UX for + visualization. + + The map keys are string identifiers (for example, a cluster id or a sample id) + and the values are the coordinates and visual size for rendering on a 2D chart. + + This property is omitted unless the client requests coordinates (for example, + by passing ``includeCoordinates=true`` as a query parameter). + + Example: + + .. code-block:: + + { + "cluster-1": { "x": 12, "y": 34, "size": 8 }, + "sample-123": { "x": 18, "y": 22, "size": 4 } + } + + Coordinates are intended only for client-side visualization and do not + modify the canonical insights results. + :vartype coordinates: dict[str, ~azure.ai.projects.models.ChartCoordinate] """ - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Automatically creates a container for this request. Required. 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.ContainerNetworkPolicyParam"] = rest_field( + summary: "_models.InsightSummary" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Summary of the insights report. Required.""" + clusters: list["_models.InsightCluster"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of clusters identified in the insights. Required.""" + coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) + """ Optional mapping of IDs to 2D coordinates used by the UX for visualization. + + The map keys are string identifiers (for example, a cluster id or a sample id) + and the values are the coordinates and visual size for rendering on a 2D chart. + + This property is omitted unless the client requests coordinates (for example, + by passing ``includeCoordinates=true`` as a query parameter). + + Example: + + .. code-block:: + + { + \"cluster-1\": { \"x\": 12, \"y\": 34, \"size\": 8 }, + \"sample-123\": { \"x\": 18, \"y\": 22, \"size\": 4 } + } + + Coordinates are intended only for client-side visualization and do not + modify the canonical insights results.""" @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.ContainerNetworkPolicyParam"] = None, + summary: "_models.InsightSummary", + clusters: list["_models.InsightCluster"], + coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = None, ) -> None: ... @overload @@ -3860,24 +3986,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = FunctionShellToolParamEnvironmentType.CONTAINER_AUTO # type: ignore -class ContainerConfiguration(_Model): - """Container-based deployment configuration for a hosted agent. +class ClusterTokenUsage(_Model): + """Token usage for cluster analysis. - :ivar image: The container image for the hosted agent. Required. - :vartype image: str + :ivar input_token_usage: input token usage. Required. + :vartype input_token_usage: int + :ivar output_token_usage: output token usage. Required. + :vartype output_token_usage: int + :ivar total_token_usage: total token usage. Required. + :vartype total_token_usage: int """ - image: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The container image for the hosted agent. Required.""" + input_token_usage: int = rest_field( + name="inputTokenUsage", visibility=["read", "create", "update", "delete", "query"] + ) + """input token usage. Required.""" + output_token_usage: int = rest_field( + name="outputTokenUsage", visibility=["read", "create", "update", "delete", "query"] + ) + """output token usage. Required.""" + total_token_usage: int = rest_field( + name="totalTokenUsage", visibility=["read", "create", "update", "delete", "query"] + ) + """total token usage. Required.""" @overload def __init__( self, *, - image: str, + input_token_usage: int, + output_token_usage: int, + total_token_usage: int, ) -> None: ... @overload @@ -3891,25 +4032,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerNetworkPolicyParam(_Model): - """Network access policy for the container. +class EvaluatorDefinition(_Model): + """Base evaluator configuration with discriminator. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ContainerNetworkPolicyAllowlistParam, ContainerNetworkPolicyDisabledParam + CodeBasedEvaluatorDefinition, EndpointBasedEvaluatorDefinition, PromptBasedEvaluatorDefinition, + RubricBasedEvaluatorDefinition - :ivar type: Required. Known values are: "disabled" and "allowlist". - :vartype type: str or ~azure.ai.projects.models.ContainerNetworkPolicyParamType + :ivar type: The type of evaluator definition. Required. Known values are: "prompt", "code", + "prompt_and_code", "service", "openai_graders", "rubric", and "endpoint". + :vartype type: str or ~azure.ai.projects.models.EvaluatorDefinitionType + :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] """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"disabled\" and \"allowlist\".""" + """The type of evaluator definition. Required. Known values are: \"prompt\", \"code\", + \"prompt_and_code\", \"service\", \"openai_graders\", \"rubric\", and \"endpoint\".""" + init_parameters: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters + like type, properties, required.""" + data_schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like + type, properties, required.""" + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of output metrics produced by this evaluator.""" @overload def __init__( self, *, type: str, + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, ) -> None: ... @overload @@ -3923,35 +4088,53 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerNetworkPolicyAllowlistParam(ContainerNetworkPolicyParam, discriminator="allowlist"): - """ContainerNetworkPolicyAllowlistParam. +class CodeBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="code"): + """Code-based evaluator definition using python code. - :ivar type: Allow outbound network access only to specified domains. Always ``allowlist``. - Required. ALLOWLIST. - :vartype type: str or ~azure.ai.projects.models.ALLOWLIST - :ivar allowed_domains: A list of allowed domains when type is ``allowlist``. Required. - :vartype allowed_domains: list[str] - :ivar domain_secrets: Optional domain-scoped secrets for allowlisted domains. - :vartype domain_secrets: - list[~azure.ai.projects.models.ContainerNetworkPolicyDomainSecretParam] + :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. Code-based definition. + :vartype type: str or ~azure.ai.projects.models.CODE + :ivar code_text: Inline code text for the evaluator. + :vartype code_text: str + :ivar entry_point: The entry point Python file name for the uploaded evaluator code (e.g. + 'answer_length_evaluator.py'). + :vartype entry_point: str + :ivar image_tag: The container image tag to use for evaluator code execution. + :vartype image_tag: str + :ivar blob_uri: The blob URI for the evaluator storage. + :vartype blob_uri: str """ - type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Allow outbound network access only to specified domains. Always ``allowlist``. Required. - ALLOWLIST.""" - allowed_domains: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A list of allowed domains when type is ``allowlist``. Required.""" - domain_secrets: Optional[list["_models.ContainerNetworkPolicyDomainSecretParam"]] = rest_field( - visibility=["create"] - ) - """Optional domain-scoped secrets for allowlisted domains.""" + type: Literal[EvaluatorDefinitionType.CODE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Code-based definition.""" + code_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inline code text for the evaluator.""" + entry_point: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The entry point Python file name for the uploaded evaluator code (e.g. + 'answer_length_evaluator.py').""" + image_tag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The container image tag to use for evaluator code execution.""" + blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The blob URI for the evaluator storage.""" @overload def __init__( self, *, - allowed_domains: list[str], - domain_secrets: Optional[list["_models.ContainerNetworkPolicyDomainSecretParam"]] = None, + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, + code_text: Optional[str] = None, + entry_point: Optional[str] = None, + image_tag: Optional[str] = None, + blob_uri: Optional[str] = None, ) -> None: ... @overload @@ -3963,22 +4146,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContainerNetworkPolicyParamType.ALLOWLIST # type: ignore + self.type = EvaluatorDefinitionType.CODE # type: ignore -class ContainerNetworkPolicyDisabledParam(ContainerNetworkPolicyParam, discriminator="disabled"): - """ContainerNetworkPolicyDisabledParam. +class CodeConfiguration(_Model): + """Code-based deployment configuration for a hosted agent. - :ivar type: Disable outbound network access. Always ``disabled``. Required. DISABLED. - :vartype type: str or ~azure.ai.projects.models.DISABLED + :ivar runtime: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', + 'python_3_13'). Required. + :vartype runtime: str + :ivar entry_point: The entry point command and arguments for the code execution. Required. + :vartype entry_point: list[str] + :ivar dependency_resolution: How package dependencies are resolved at deployment time. Defaults + to ``bundled``, where the caller bundles all dependencies into the uploaded zip and the service + performs no remote build. ``remote_build`` instructs the service to build dependencies remotely + from the manifest included in the uploaded zip. Required. Known values are: "bundled" and + "remote_build". + :vartype dependency_resolution: str or ~azure.ai.projects.models.CodeDependencyResolution + :ivar content_hash: The SHA-256 hex digest of the uploaded code zip. Set by the service from + the ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in + request payloads. + :vartype content_hash: str """ - type: Literal[ContainerNetworkPolicyParamType.DISABLED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Disable outbound network access. Always ``disabled``. Required. DISABLED.""" + runtime: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13'). + Required.""" + entry_point: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The entry point command and arguments for the code execution. Required.""" + dependency_resolution: Union[str, "_models.CodeDependencyResolution"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """How package dependencies are resolved at deployment time. Defaults to ``bundled``, where the + caller bundles all dependencies into the uploaded zip and the service performs no remote build. + ``remote_build`` instructs the service to build dependencies remotely from the manifest + included in the uploaded zip. Required. Known values are: \"bundled\" and \"remote_build\".""" + content_hash: Optional[str] = rest_field(visibility=["read"]) + """The SHA-256 hex digest of the uploaded code zip. Set by the service from the + ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in request + payloads.""" @overload def __init__( self, + *, + runtime: str, + entry_point: list[str], + dependency_resolution: Union[str, "_models.CodeDependencyResolution"], ) -> None: ... @overload @@ -3990,34 +4204,55 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContainerNetworkPolicyParamType.DISABLED # type: ignore -class ContainerNetworkPolicyDomainSecretParam(_Model): - """ContainerNetworkPolicyDomainSecretParam. +class CodeInterpreterTool(Tool, discriminator="code_interpreter"): + """Code interpreter. - :ivar domain: The domain associated with the secret. Required. - :vartype domain: str - :ivar name: The name of the secret to inject for the domain. Required. - :vartype name: str - :ivar value: The secret value to inject for the domain. Required. - :vartype value: str + :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 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 """ - domain: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The domain associated with the secret. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the secret to inject for the domain. Required.""" - value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The secret value to inject for the domain. Required.""" + 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.""" + 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, *, - domain: str, - name: str, - value: str, + 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 @@ -4029,27 +4264,47 @@ 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 ContainerSkill(_Model): - """ContainerSkill. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - InlineSkillParam, SkillReferenceParam +class CodeInterpreterToolboxTool(ToolboxTool, discriminator="code_interpreter"): + """A code interpreter tool stored in a toolbox. - :ivar type: Required. Known values are: "skill_reference" and "inline". - :vartype type: str or ~azure.ai.projects.models.ContainerSkillType + :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. CODE_INTERPRETER. + :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER + :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 """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"skill_reference\" and \"inline\".""" + type: Literal[ToolboxToolType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. CODE_INTERPRETER.""" + 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, *, - type: str, + 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 @@ -4061,29 +4316,63 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolboxToolType.CODE_INTERPRETER # type: ignore -class EvaluationRuleAction(_Model): - """Evaluation action model. +class ComparisonFilter(_Model): + """Comparison Filter. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ContinuousEvaluationRuleAction, HumanEvaluationPreviewRuleAction + :ivar type: Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, + ``lte``, ``in``, ``nin``. - :ivar type: Type of the evaluation action. Required. Known values are: "continuousEvaluation" - and "humanEvaluationPreview". - :vartype type: str or ~azure.ai.projects.models.EvaluationRuleActionType + * `eq`: equals + * `ne`: not equal + * `gt`: greater than + * `gte`: greater than or equal + * `lt`: less than + * `lte`: less than or equal + * `in`: in + * `nin`: not in. Required. Is one of the following types: Literal["eq"], Literal["ne"], + Literal["gt"], Literal["gte"], Literal["lt"], Literal["lte"], Literal["in"], Literal["nin"] + :vartype type: str or str or str or str or str or str or str or str + :ivar key: The key to compare against the value. Required. + :vartype key: str + :ivar value: The value to compare against the attribute key; supports string, number, or + boolean types. Required. Is one of the following types: str, float, bool, [Union[str, float]] + :vartype value: str or float or bool or list[str or float] """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of the evaluation action. Required. Known values are: \"continuousEvaluation\" and - \"humanEvaluationPreview\".""" + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, ``lte``, ``in``, + ``nin``. + + * `eq`: equals + * `ne`: not equal + * `gt`: greater than + * `gte`: greater than or equal + * `lt`: less than + * `lte`: less than or equal + * `in`: in + * `nin`: not in. Required. Is one of the following types: Literal[\"eq\"], + Literal[\"ne\"], Literal[\"gt\"], Literal[\"gte\"], Literal[\"lt\"], Literal[\"lte\"], + Literal[\"in\"], Literal[\"nin\"]""" + key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The key to compare against the value. Required.""" + value: Union[str, float, bool, list[Union[str, float]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The value to compare against the attribute key; supports string, number, or boolean types. + Required. Is one of the following types: str, float, bool, [Union[str, float]]""" @overload def __init__( self, *, - type: str, + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"], + key: str, + value: Union[str, float, bool, list[Union[str, float]]], ) -> None: ... @overload @@ -4097,43 +4386,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator="continuousEvaluation"): - """Evaluation rule action for continuous evaluation. +class CompoundFilter(_Model): + """Compound Filter. - :ivar type: Required. Continuous evaluation. - :vartype type: str or ~azure.ai.projects.models.CONTINUOUS_EVALUATION - :ivar eval_id: Eval Id to add continuous evaluation runs to. Required. - :vartype eval_id: str - :ivar max_hourly_runs: Maximum number of evaluation runs allowed per hour. - :vartype max_hourly_runs: int - :ivar sampling_rate: Percentage (0-100] chance that a matching event triggers an evaluation. - When omitted, the service-default is to evaluate every event, which is equivalent to setting a - sampling rate of 100. - :vartype sampling_rate: float + :ivar type: Type of operation: ``and`` or ``or``. Required. Is either a Literal["and"] type or + a Literal["or"] type. + :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] """ - type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Continuous evaluation.""" - eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) - """Eval Id to add continuous evaluation runs to. Required.""" - max_hourly_runs: Optional[int] = rest_field( - name="maxHourlyRuns", visibility=["read", "create", "update", "delete", "query"] - ) - """Maximum number of evaluation runs allowed per hour.""" - sampling_rate: Optional[float] = rest_field( - name="samplingRate", visibility=["read", "create", "update", "delete", "query"] + 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( + visibility=["read", "create", "update", "delete", "query"] ) - """Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the - service-default is to evaluate every event, which is equivalent to setting a sampling rate of - 100.""" + """Array of filters to combine. Items can be ``ComparisonFilter`` or ``CompoundFilter``. Required.""" @overload def __init__( self, *, - eval_id: str, - max_hourly_runs: Optional[int] = None, - sampling_rate: Optional[float] = None, + type: Literal["and", "or"], + filters: list[Union["_models.ComparisonFilter", Any]], ) -> None: ... @overload @@ -4145,62 +4422,21 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluationRuleActionType.CONTINUOUS_EVALUATION # type: ignore -class CosmosDBIndex(Index, discriminator="CosmosDBNoSqlVectorStore"): - """CosmosDB Vector Store Index Definition. +class ComputerTool(Tool, discriminator="computer"): + """Computer. - :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. CosmosDB. - :vartype type: str or ~azure.ai.projects.models.COSMOS_DB - :ivar connection_name: Name of connection to CosmosDB. Required. - :vartype connection_name: str - :ivar database_name: Name of the CosmosDB Database. Required. - :vartype database_name: str - :ivar container_name: Name of CosmosDB Container. Required. - :vartype container_name: str - :ivar embedding_configuration: Embedding model configuration. Required. - :vartype embedding_configuration: ~azure.ai.projects.models.EmbeddingConfiguration - :ivar field_mapping: Field mapping configuration. Required. - :vartype field_mapping: ~azure.ai.projects.models.FieldMapping + :ivar type: The type of the computer tool. Always ``computer``. Required. COMPUTER. + :vartype type: str or ~azure.ai.projects.models.COMPUTER """ - type: Literal[IndexType.COSMOS_DB] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of index. Required. CosmosDB.""" - connection_name: str = rest_field(name="connectionName", visibility=["create"]) - """Name of connection to CosmosDB. Required.""" - database_name: str = rest_field(name="databaseName", visibility=["create"]) - """Name of the CosmosDB Database. Required.""" - container_name: str = rest_field(name="containerName", visibility=["create"]) - """Name of CosmosDB Container. Required.""" - embedding_configuration: "_models.EmbeddingConfiguration" = rest_field( - name="embeddingConfiguration", visibility=["create"] - ) - """Embedding model configuration. Required.""" - field_mapping: "_models.FieldMapping" = rest_field(name="fieldMapping", visibility=["create"]) - """Field mapping configuration. Required.""" + 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, - *, - connection_name: str, - database_name: str, - container_name: str, - embedding_configuration: "_models.EmbeddingConfiguration", - field_mapping: "_models.FieldMapping", - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -4212,32 +4448,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = IndexType.COSMOS_DB # type: ignore + self.type = ToolType.COMPUTER # type: ignore -class CreateAsyncResponse(_Model): - """CreateAsyncResponse. +class ComputerUsePreviewTool(Tool, discriminator="computer_use_preview"): + """Computer use preview. - :ivar location: URL to poll for operation status. - :vartype location: str - :ivar operation_result: URL to the operation result, or null if the operation is still in - progress. - :vartype operation_result: str + :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 """ - location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """URL to poll for operation status.""" - operation_result: Optional[str] = rest_field( - name="operationResult", 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"] ) - """URL to the operation result, or null if the operation is still in progress.""" + """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, *, - location: Optional[str] = None, - operation_result: Optional[str] = None, + environment: Union[str, "_models.ComputerEnvironment"], + display_width: int, + display_height: int, ) -> None: ... @overload @@ -4249,61 +4497,63 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.COMPUTER_USE_PREVIEW # type: ignore -class CreateSkillVersionFromFilesBody(_Model): - """Multipart request body for creating a skill version from files. Accepts either a single zip - file or multiple individual skill files (directory upload). For zip uploads, the server - extracts and validates contents. For directory uploads, files are validated as-is. +class Connection(_Model): + """Response from the list and get connections operations. - :ivar files: Skill files to upload. Upload a single zip file or multiple individual files with - relative paths. Required. - :vartype files: list[~azure.ai.projects._utils.utils.FileType] - :ivar default: Whether to set this version as the default. Defaults to false. - :vartype default: bool + :ivar name: The friendly name of the connection, provided by the user. Required. + :vartype name: str + :ivar id: A unique identifier for the connection, generated by the service. Required. + :vartype id: str + :ivar type: Category of the connection. Required. Known values are: "AzureOpenAI", "AzureBlob", + "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", "AppConfig", "AppInsights", + "CustomKeys", and "RemoteTool_Preview". + :vartype type: str or ~azure.ai.projects.models.ConnectionType + :ivar target: The connection URL to be used for this service. Required. + :vartype target: str + :ivar is_default: Whether the connection is tagged as the default connection of its type. + Required. + :vartype is_default: bool + :ivar credentials: The credentials used by the connection. Required. + :vartype credentials: ~azure.ai.projects.models.BaseCredentials + :ivar metadata: Metadata of the connection. Required. + :vartype metadata: dict[str, str] """ - files: list[FileType] = rest_field( - visibility=["read", "create", "update", "delete", "query"], is_multipart_file_input=True - ) - """Skill files to upload. Upload a single zip file or multiple individual files with relative - paths. Required.""" - default: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to set this version as the default. Defaults to false.""" - - @overload - def __init__( - self, - *, - files: list[FileType], - default: 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) + name: str = rest_field(visibility=["read"]) + """The friendly name of the connection, provided by the user. Required.""" + id: str = rest_field(visibility=["read"]) + """A unique identifier for the connection, generated by the service. Required.""" + type: Union[str, "_models.ConnectionType"] = rest_field(visibility=["read"]) + """Category of the connection. Required. Known values are: \"AzureOpenAI\", \"AzureBlob\", + \"AzureStorageAccount\", \"CognitiveSearch\", \"CosmosDB\", \"ApiKey\", \"AppConfig\", + \"AppInsights\", \"CustomKeys\", and \"RemoteTool_Preview\".""" + target: str = rest_field(visibility=["read"]) + """The connection URL to be used for this service. Required.""" + is_default: bool = rest_field(name="isDefault", visibility=["read"]) + """Whether the connection is tagged as the default connection of its type. Required.""" + credentials: "_models.BaseCredentials" = rest_field(visibility=["read"]) + """The credentials used by the connection. Required.""" + metadata: dict[str, str] = rest_field(visibility=["read"]) + """Metadata of the connection. Required.""" -class Trigger(_Model): - """Base model for Trigger of the schedule. +class FunctionShellToolParamEnvironment(_Model): + """FunctionShellToolParamEnvironment. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CronTrigger, OneTimeTrigger, RecurrenceTrigger + ContainerAutoParam, FunctionShellToolParamEnvironmentContainerReferenceParam, + FunctionShellToolParamEnvironmentLocalEnvironmentParam - :ivar type: Type of the trigger. Required. Known values are: "Cron", "Recurrence", and - "OneTime". - :vartype type: str or ~azure.ai.projects.models.TriggerType + :ivar type: Required. Known values are: "container_auto", "local", and "container_reference". + :vartype type: str or ~azure.ai.projects.models.FunctionShellToolParamEnvironmentType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of the trigger. Required. Known values are: \"Cron\", \"Recurrence\", and \"OneTime\".""" + """Required. Known values are: \"container_auto\", \"local\", and \"container_reference\".""" @overload def __init__( @@ -4323,44 +4573,45 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CronTrigger(Trigger, discriminator="Cron"): - """Cron based trigger. +class ContainerAutoParam(FunctionShellToolParamEnvironment, discriminator="container_auto"): + """ContainerAutoParam. - :ivar type: Required. Cron based trigger. - :vartype type: str or ~azure.ai.projects.models.CRON - :ivar expression: Cron expression that defines the schedule frequency. Required. - :vartype expression: str - :ivar time_zone: Time zone for the cron schedule. Defaults to ``UTC``. - :vartype time_zone: str - :ivar start_time: Start time for the cron schedule in ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar end_time: End time for the cron schedule in ISO 8601 format. - :vartype end_time: ~datetime.datetime + :ivar type: Automatically creates a container for this request. Required. CONTAINER_AUTO. + :vartype type: str or ~azure.ai.projects.models.CONTAINER_AUTO + :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: + :vartype network_policy: ~azure.ai.projects.models.ContainerNetworkPolicyParam """ - type: Literal[TriggerType.CRON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Cron based trigger.""" - expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Cron expression that defines the schedule frequency. Required.""" - time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Time zone for the cron schedule. Defaults to ``UTC``.""" - start_time: Optional[datetime.datetime] = rest_field( - name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Automatically creates a container for this request. Required. 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"] ) - """Start time for the cron schedule in ISO 8601 format.""" - end_time: Optional[datetime.datetime] = rest_field( - name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + """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.ContainerNetworkPolicyParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """End time for the cron schedule in ISO 8601 format.""" @overload def __init__( self, *, - expression: str, - time_zone: Optional[str] = None, - start_time: Optional[datetime.datetime] = None, - end_time: Optional[datetime.datetime] = None, + file_ids: Optional[list[str]] = None, + memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = None, + skills: Optional[list["_models.ContainerSkill"]] = None, + network_policy: Optional["_models.ContainerNetworkPolicyParam"] = None, ) -> None: ... @overload @@ -4372,22 +4623,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TriggerType.CRON # type: ignore + self.type = FunctionShellToolParamEnvironmentType.CONTAINER_AUTO # type: ignore -class CustomCredential(BaseCredentials, discriminator="CustomKeys"): - """Custom credential definition. +class ContainerConfiguration(_Model): + """Container-based deployment configuration for a hosted agent. - :ivar type: The credential type. Required. Custom credential. - :vartype type: str or ~azure.ai.projects.models.CUSTOM + :ivar image: The container image for the hosted agent. Required. + :vartype image: str + :ivar registry_connection_id: The id (or name) of the Foundry project connection that provides + the credentials used to authenticate to the private container registry hosting ``image``. The + connection abstracts the auth mechanism — for example a managed-identity-federated token + exchange, or a username/token secret — so registry credentials are never part of the agent + definition. Omit for public images or registries already reachable by the platform's default + identity (for example, Azure Container Registry). + :vartype registry_connection_id: str """ - type: Literal[CredentialType.CUSTOM] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. Custom credential.""" + image: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The container image for the hosted agent. Required.""" + registry_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id (or name) of the Foundry project connection that provides the credentials used to + authenticate to the private container registry hosting ``image``. The connection abstracts the + auth mechanism — for example a managed-identity-federated token exchange, or a username/token + secret — so registry credentials are never part of the agent definition. Omit for public images + or registries already reachable by the platform's default identity (for example, Azure + Container Registry).""" @overload def __init__( self, + *, + image: str, + registry_connection_id: Optional[str] = None, ) -> None: ... @overload @@ -4399,22 +4667,21 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.CUSTOM # type: ignore -class CustomToolParamFormat(_Model): - """The input format for the custom tool. Default is unconstrained text. +class ContainerNetworkPolicyParam(_Model): + """Network access policy for the container. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CustomGrammarFormatParam, CustomTextFormatParam + ContainerNetworkPolicyAllowlistParam, ContainerNetworkPolicyDisabledParam - :ivar type: Required. Known values are: "text" and "grammar". - :vartype type: str or ~azure.ai.projects.models.CustomToolParamFormatType + :ivar type: Required. Known values are: "disabled" and "allowlist". + :vartype type: str or ~azure.ai.projects.models.ContainerNetworkPolicyParamType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"text\" and \"grammar\".""" + """Required. Known values are: \"disabled\" and \"allowlist\".""" @overload def __init__( @@ -4434,34 +4701,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CustomGrammarFormatParam(CustomToolParamFormat, discriminator="grammar"): - """Grammar format. +class ContainerNetworkPolicyAllowlistParam(ContainerNetworkPolicyParam, discriminator="allowlist"): + """ContainerNetworkPolicyAllowlistParam. - :ivar type: Grammar format. Always ``grammar``. Required. GRAMMAR. - :vartype type: str or ~azure.ai.projects.models.GRAMMAR - :ivar syntax: The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. - Known values are: "lark" and "regex". - :vartype syntax: str or ~azure.ai.projects.models.GrammarSyntax1 - :ivar definition: The grammar definition. Required. - :vartype definition: str + :ivar type: Allow outbound network access only to specified domains. Always ``allowlist``. + Required. ALLOWLIST. + :vartype type: str or ~azure.ai.projects.models.ALLOWLIST + :ivar allowed_domains: A list of allowed domains when type is ``allowlist``. Required. + :vartype allowed_domains: list[str] + :ivar domain_secrets: Optional domain-scoped secrets for allowlisted domains. + :vartype domain_secrets: + list[~azure.ai.projects.models.ContainerNetworkPolicyDomainSecretParam] """ - type: Literal[CustomToolParamFormatType.GRAMMAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Grammar format. Always ``grammar``. Required. GRAMMAR.""" - syntax: Union[str, "_models.GrammarSyntax1"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Allow outbound network access only to specified domains. Always ``allowlist``. Required. + ALLOWLIST.""" + allowed_domains: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A list of allowed domains when type is ``allowlist``. Required.""" + domain_secrets: Optional[list["_models.ContainerNetworkPolicyDomainSecretParam"]] = rest_field( + visibility=["create"] ) - """The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. Known values are: - \"lark\" and \"regex\".""" - definition: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The grammar definition. Required.""" + """Optional domain-scoped secrets for allowlisted domains.""" @overload def __init__( self, *, - syntax: Union[str, "_models.GrammarSyntax1"], - definition: str, + allowed_domains: list[str], + domain_secrets: Optional[list["_models.ContainerNetworkPolicyDomainSecretParam"]] = None, ) -> None: ... @overload @@ -4473,30 +4741,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CustomToolParamFormatType.GRAMMAR # type: ignore - + self.type = ContainerNetworkPolicyParamType.ALLOWLIST # type: ignore -class RoutineTrigger(_Model): - """Base model for a routine trigger. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CustomRoutineTrigger, GitHubIssueRoutineTrigger, ScheduleRoutineTrigger, TimerRoutineTrigger +class ContainerNetworkPolicyDisabledParam(ContainerNetworkPolicyParam, discriminator="disabled"): + """ContainerNetworkPolicyDisabledParam. - :ivar type: The trigger type. Required. Known values are: "custom", "github_issue", "schedule", - and "timer". - :vartype type: str or ~azure.ai.projects.models.RoutineTriggerType + :ivar type: Disable outbound network access. Always ``disabled``. Required. DISABLED. + :vartype type: str or ~azure.ai.projects.models.DISABLED """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The trigger type. Required. Known values are: \"custom\", \"github_issue\", \"schedule\", and - \"timer\".""" + type: Literal[ContainerNetworkPolicyParamType.DISABLED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Disable outbound network access. Always ``disabled``. Required. DISABLED.""" @overload def __init__( self, - *, - type: str, ) -> None: ... @overload @@ -4508,37 +4768,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ContainerNetworkPolicyParamType.DISABLED # type: ignore -class CustomRoutineTrigger(RoutineTrigger, discriminator="custom"): - """A custom event routine trigger. +class ContainerNetworkPolicyDomainSecretParam(_Model): + """ContainerNetworkPolicyDomainSecretParam. - :ivar type: The trigger type. Required. A custom event trigger. - :vartype type: str or ~azure.ai.projects.models.CUSTOM - :ivar provider: The external provider that emits the custom event. Required. - :vartype provider: str - :ivar event_name: The provider-specific event name that fires the routine. - :vartype event_name: str - :ivar parameters: Provider-specific trigger parameters. Required. - :vartype parameters: dict[str, any] + :ivar domain: The domain associated with the secret. Required. + :vartype domain: str + :ivar name: The name of the secret to inject for the domain. Required. + :vartype name: str + :ivar value: The secret value to inject for the domain. Required. + :vartype value: str """ - type: Literal[RoutineTriggerType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The trigger type. Required. A custom event trigger.""" - provider: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The external provider that emits the custom event. Required.""" - event_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider-specific event name that fires the routine.""" - parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Provider-specific trigger parameters. Required.""" + domain: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The domain associated with the secret. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the secret to inject for the domain. Required.""" + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The secret value to inject for the domain. Required.""" @overload def __init__( self, *, - provider: str, - parameters: dict[str, Any], - event_name: Optional[str] = None, + domain: str, + name: str, + value: str, ) -> None: ... @overload @@ -4550,72 +4807,27 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineTriggerType.CUSTOM # type: ignore - - -class CustomTextFormatParam(CustomToolParamFormat, discriminator="text"): - """Text format. - - :ivar type: Unconstrained text format. Always ``text``. Required. TEXT. - :vartype type: str or ~azure.ai.projects.models.TEXT - """ - - type: Literal[CustomToolParamFormatType.TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Unconstrained text format. 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 = CustomToolParamFormatType.TEXT # type: ignore +class ContainerSkill(_Model): + """ContainerSkill. -class CustomToolParam(Tool, discriminator="custom"): - """Custom tool. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + InlineSkillParam, SkillReferenceParam - :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 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 type: Required. Known values are: "skill_reference" and "inline". + :vartype type: str or ~azure.ai.projects.models.ContainerSkillType """ - 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.""" - 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.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"skill_reference\" and \"inline\".""" @overload def __init__( self, *, - name: str, - description: Optional[str] = None, - format: Optional["_models.CustomToolParamFormat"] = None, - defer_loading: Optional[bool] = None, + type: str, ) -> None: ... @overload @@ -4627,25 +4839,23 @@ 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 -class RecurrenceSchedule(_Model): - """Recurrence schedule model. +class EvaluationRuleAction(_Model): + """Evaluation action model. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DailyRecurrenceSchedule, HourlyRecurrenceSchedule, MonthlyRecurrenceSchedule, - WeeklyRecurrenceSchedule + ContinuousEvaluationRuleAction, HumanEvaluationPreviewRuleAction - :ivar type: Recurrence type for the recurrence schedule. Required. Known values are: "Hourly", - "Daily", "Weekly", and "Monthly". - :vartype type: str or ~azure.ai.projects.models.RecurrenceType + :ivar type: Type of the evaluation action. Required. Known values are: "continuousEvaluation" + and "humanEvaluationPreview". + :vartype type: str or ~azure.ai.projects.models.EvaluationRuleActionType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Recurrence type for the recurrence schedule. Required. Known values are: \"Hourly\", \"Daily\", - \"Weekly\", and \"Monthly\".""" + """Type of the evaluation action. Required. Known values are: \"continuousEvaluation\" and + \"humanEvaluationPreview\".""" @overload def __init__( @@ -4665,25 +4875,43 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DailyRecurrenceSchedule(RecurrenceSchedule, discriminator="Daily"): - """Daily recurrence schedule. +class ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator="continuousEvaluation"): + """Evaluation rule action for continuous evaluation. - :ivar type: Daily recurrence type. Required. Daily recurrence pattern. - :vartype type: str or ~azure.ai.projects.models.DAILY - :ivar hours: Hours for the recurrence schedule. Required. - :vartype hours: list[int] + :ivar type: Required. Continuous evaluation. + :vartype type: str or ~azure.ai.projects.models.CONTINUOUS_EVALUATION + :ivar eval_id: Eval Id to add continuous evaluation runs to. Required. + :vartype eval_id: str + :ivar max_hourly_runs: Maximum number of evaluation runs allowed per hour. + :vartype max_hourly_runs: int + :ivar sampling_rate: Percentage (0-100] chance that a matching event triggers an evaluation. + When omitted, the service-default is to evaluate every event, which is equivalent to setting a + sampling rate of 100. + :vartype sampling_rate: float """ - type: Literal[RecurrenceType.DAILY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Daily recurrence type. Required. Daily recurrence pattern.""" - hours: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Hours for the recurrence schedule. Required.""" + type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Continuous evaluation.""" + eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) + """Eval Id to add continuous evaluation runs to. Required.""" + max_hourly_runs: Optional[int] = rest_field( + name="maxHourlyRuns", visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of evaluation runs allowed per hour.""" + sampling_rate: Optional[float] = rest_field( + name="samplingRate", visibility=["read", "create", "update", "delete", "query"] + ) + """Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the + service-default is to evaluate every event, which is equivalent to setting a sampling rate of + 100.""" @overload def __init__( self, *, - hours: list[int], + eval_id: str, + max_hourly_runs: Optional[int] = None, + sampling_rate: Optional[float] = None, ) -> None: ... @overload @@ -4695,56 +4923,62 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RecurrenceType.DAILY # type: ignore + self.type = EvaluationRuleActionType.CONTINUOUS_EVALUATION # type: ignore -class DataGenerationJob(_Model): - """Data Generation Job resource. +class CosmosDBIndex(Index, discriminator="CosmosDBNoSqlVectorStore"): + """CosmosDB Vector Store Index Definition. - :ivar id: Server-assigned unique identifier. Required. + :ivar id: Asset ID, a unique identifier for the asset. :vartype id: str - :ivar inputs: Caller-supplied inputs. - :vartype inputs: ~azure.ai.projects.models.DataGenerationJobInputs - :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 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 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. CosmosDB. + :vartype type: str or ~azure.ai.projects.models.COSMOS_DB + :ivar connection_name: Name of connection to CosmosDB. Required. + :vartype connection_name: str + :ivar database_name: Name of the CosmosDB Database. Required. + :vartype database_name: str + :ivar container_name: Name of CosmosDB Container. Required. + :vartype container_name: str + :ivar embedding_configuration: Embedding model configuration. Required. + :vartype embedding_configuration: ~azure.ai.projects.models.EmbeddingConfiguration + :ivar field_mapping: Field mapping configuration. Required. + :vartype field_mapping: ~azure.ai.projects.models.FieldMapping """ - id: str = rest_field(visibility=["read"]) - """Server-assigned unique identifier. Required.""" - inputs: Optional["_models.DataGenerationJobInputs"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal[IndexType.COSMOS_DB] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of index. Required. CosmosDB.""" + connection_name: str = rest_field(name="connectionName", visibility=["create"]) + """Name of connection to CosmosDB. Required.""" + database_name: str = rest_field(name="databaseName", visibility=["create"]) + """Name of the CosmosDB Database. Required.""" + container_name: str = rest_field(name="containerName", visibility=["create"]) + """Name of CosmosDB Container. Required.""" + embedding_configuration: "_models.EmbeddingConfiguration" = rest_field( + name="embeddingConfiguration", visibility=["create"] ) - """Caller-supplied inputs.""" - result: Optional["_models.DataGenerationJobResult"] = rest_field(visibility=["read"]) - """Result produced on success.""" - status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) - """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", - \"succeeded\", \"failed\", and \"cancelled\".""" - error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) - """Error details — populated only on failure.""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was created, represented in Unix time (seconds since January 1, - 1970). Required.""" - finished_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was finished, represented in Unix time (seconds since January 1, - 1970).""" + """Embedding model configuration. Required.""" + field_mapping: "_models.FieldMapping" = rest_field(name="fieldMapping", visibility=["create"]) + """Field mapping configuration. Required.""" @overload def __init__( self, *, - inputs: Optional["_models.DataGenerationJobInputs"] = None, + connection_name: str, + database_name: str, + container_name: str, + embedding_configuration: "_models.EmbeddingConfiguration", + field_mapping: "_models.FieldMapping", + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -4756,55 +4990,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = IndexType.COSMOS_DB # type: ignore -class DataGenerationJobInputs(_Model): - """Caller-supplied inputs for a data generation job. +class CreateAsyncResponse(_Model): + """CreateAsyncResponse. - :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 options: The options for the data generation job. Required. - :vartype options: ~azure.ai.projects.models.DataGenerationJobOptions - :ivar scenario: The scenario of the data generation job. Either for fine-tuning or evaluation. - Required. Known values are: "supervised_finetuning", "reinforcement_finetuning", and - "evaluation". - :vartype scenario: str or ~azure.ai.projects.models.DataGenerationJobScenario - :ivar output_options: Optional caller-supplied metadata for the job's output. See individual - fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs - (evaluation scenario), or both. - :vartype output_options: ~azure.ai.projects.models.DataGenerationJobOutputOptions + :ivar location: URL to poll for operation status. + :vartype location: str + :ivar operation_result: URL to the operation result, or null if the operation is still in + progress. + :vartype operation_result: str """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The display name of the data generation job. Required.""" - sources: list["_models.DataGenerationJobSource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The sources used for the data generation job. Required.""" - options: "_models.DataGenerationJobOptions" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The options for the data generation job. Required.""" - scenario: Union[str, "_models.DataGenerationJobScenario"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The scenario of the data generation job. Either for fine-tuning or evaluation. Required. Known - values are: \"supervised_finetuning\", \"reinforcement_finetuning\", and \"evaluation\".""" - output_options: Optional["_models.DataGenerationJobOutputOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """URL to poll for operation status.""" + operation_result: Optional[str] = rest_field( + name="operationResult", visibility=["read", "create", "update", "delete", "query"] ) - """Optional caller-supplied metadata for the job's output. See individual fields for whether they - apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both.""" + """URL to the operation result, or null if the operation is still in progress.""" @overload def __init__( self, *, - name: str, - sources: list["_models.DataGenerationJobSource"], - options: "_models.DataGenerationJobOptions", - scenario: Union[str, "_models.DataGenerationJobScenario"], - output_options: Optional["_models.DataGenerationJobOutputOptions"] = None, + location: Optional[str] = None, + operation_result: Optional[str] = None, ) -> None: ... @overload @@ -4818,47 +5029,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobOptions(_Model): - """Options for managing data generation jobs. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - SimpleQnADataGenerationJobOptions, TaskGenerationDataGenerationJobOptions, - ToolUseFineTuningDataGenerationJobOptions, TracesDataGenerationJobOptions +class CreateSkillVersionFromFilesBody(_Model): + """Multipart request body for creating a skill version from files. Accepts either a single zip + file or multiple individual skill files (directory upload). For zip uploads, the server + extracts and validates contents. For directory uploads, files are validated as-is. - :ivar type: The data generation job type. Required. Known values are: "simple_qna", "traces", - "tool_use", and "task_generation". - :vartype type: str or ~azure.ai.projects.models.DataGenerationJobType - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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 files: Skill files to upload. Upload a single zip file or multiple individual files with + relative paths. Required. + :vartype files: list[~azure.ai.projects._utils.utils.FileType] + :ivar default: Whether to set this version as the default. Defaults to false. + :vartype default: bool """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The data generation job type. Required. Known values are: \"simple_qna\", \"traces\", - \"tool_use\", and \"task_generation\".""" - max_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of samples to generate. Required.""" - train_split: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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.""" - model_options: Optional["_models.DataGenerationModelOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + files: list[FileType] = rest_field( + visibility=["read", "create", "update", "delete", "query"], is_multipart_file_input=True ) - """The LLM model options.""" + """Skill files to upload. Upload a single zip file or multiple individual files with relative + paths. Required.""" + default: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to set this version as the default. Defaults to false.""" @overload def __init__( self, *, - type: str, - max_samples: int, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, + files: list[FileType], + default: Optional[bool] = None, ) -> None: ... @overload @@ -4872,19 +5068,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobOutput(_Model): - """Output information for a data generation job. +class Trigger(_Model): + """Base model for Trigger of the schedule. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DatasetDataGenerationJobOutput, FileDataGenerationJobOutput + CronTrigger, OneTimeTrigger, RecurrenceTrigger - :ivar type: The type of the output. Required. Known values are: "file" and "dataset". - :vartype type: str or ~azure.ai.projects.models.DataGenerationJobOutputType + :ivar type: Type of the trigger. Required. Known values are: "Cron", "Recurrence", and + "OneTime". + :vartype type: str or ~azure.ai.projects.models.TriggerType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of the output. Required. Known values are: \"file\" and \"dataset\".""" + """Type of the trigger. Required. Known values are: \"Cron\", \"Recurrence\", and \"OneTime\".""" @overload def __init__( @@ -4904,37 +5101,44 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobOutputOptions(_Model): - """Output options for data generation job. +class CronTrigger(Trigger, discriminator="Cron"): + """Cron based trigger. - :ivar name: Name to assign to the output. Used as the filename for Azure OpenAI file outputs - (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario). - :vartype name: str - :ivar description: Description to assign to the output. Applies only to dataset outputs - (evaluation scenario); ignored for Azure OpenAI file outputs. - :vartype description: str - :ivar tags: Tags to assign to the output. Applies only to dataset outputs (evaluation - scenario); ignored for Azure OpenAI file outputs. - :vartype tags: dict[str, str] + :ivar type: Required. Cron based trigger. + :vartype type: str or ~azure.ai.projects.models.CRON + :ivar expression: Cron expression that defines the schedule frequency. Required. + :vartype expression: str + :ivar time_zone: Time zone for the cron schedule. Defaults to ``UTC``. + :vartype time_zone: str + :ivar start_time: Start time for the cron schedule in ISO 8601 format. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time for the cron schedule in ISO 8601 format. + :vartype end_time: ~datetime.datetime """ - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning - scenarios) and as the dataset name for dataset outputs (evaluation scenario).""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description to assign to the output. Applies only to dataset outputs (evaluation scenario); - ignored for Azure OpenAI file outputs.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored - for Azure OpenAI file outputs.""" + type: Literal[TriggerType.CRON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Cron based trigger.""" + expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Cron expression that defines the schedule frequency. Required.""" + time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) + """Time zone for the cron schedule. Defaults to ``UTC``.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Start time for the cron 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 cron schedule in ISO 8601 format.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + expression: str, + time_zone: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -4946,38 +5150,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = TriggerType.CRON # type: ignore -class DataGenerationJobResult(_Model): - """Result produced by a successful data generation job. +class CustomCredential(BaseCredentials, discriminator="CustomKeys"): + """Custom credential definition. - :ivar outputs: The final job outputs: Azure OpenAI files for fine-tuning, or datasets for - evaluation. - :vartype outputs: list[~azure.ai.projects.models.DataGenerationJobOutput] - :ivar generated_samples: The number of samples actually generated. Required. - :vartype generated_samples: int - :ivar token_usage: The token usage information for the data generation job. - :vartype token_usage: ~azure.ai.projects.models.DataGenerationTokenUsage + :ivar type: The credential type. Required. Custom credential. + :vartype type: str or ~azure.ai.projects.models.CUSTOM """ - outputs: Optional[list["_models.DataGenerationJobOutput"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation.""" - generated_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of samples actually generated. Required.""" - token_usage: Optional["_models.DataGenerationTokenUsage"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The token usage information for the data generation job.""" + type: Literal[CredentialType.CUSTOM] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. Custom credential.""" @overload def __init__( self, - *, - generated_samples: int, - outputs: Optional[list["_models.DataGenerationJobOutput"]] = None, - token_usage: Optional["_models.DataGenerationTokenUsage"] = None, ) -> None: ... @overload @@ -4989,23 +5177,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CredentialType.CUSTOM # type: ignore -class DataGenerationModelOptions(_Model): - """LLM model options for data generation jobs. +class CustomToolParamFormat(_Model): + """The input format for the custom tool. Default is unconstrained text. - :ivar model: Base model name used to generate data. Required. - :vartype model: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + CustomGrammarFormatParam, CustomTextFormatParam + + :ivar type: Required. Known values are: "text" and "grammar". + :vartype type: str or ~azure.ai.projects.models.CustomToolParamFormatType """ - model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Base model name used to generate data. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"text\" and \"grammar\".""" @overload def __init__( self, *, - model: str, + type: str, ) -> None: ... @overload @@ -5019,42 +5212,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationTokenUsage(_Model): - """Token usage information for a data generation job. - - :ivar prompt_tokens: The number of prompt tokens used. Required. - :vartype prompt_tokens: int - :ivar completion_tokens: The number of completion tokens generated. Required. - :vartype completion_tokens: int - :ivar total_tokens: Total number of tokens used. Required. - :vartype total_tokens: int - """ - - prompt_tokens: int = rest_field(visibility=["read"]) - """The number of prompt tokens used. Required.""" - completion_tokens: int = rest_field(visibility=["read"]) - """The number of completion tokens generated. Required.""" - total_tokens: int = rest_field(visibility=["read"]) - """Total number of tokens used. Required.""" - - -class DatasetCredential(_Model): - """Represents a reference to a blob for consumption. +class CustomGrammarFormatParam(CustomToolParamFormat, discriminator="grammar"): + """Grammar format. - :ivar blob_reference: Credential info to access the storage account. Required. - :vartype blob_reference: ~azure.ai.projects.models.BlobReference + :ivar type: Grammar format. Always ``grammar``. Required. GRAMMAR. + :vartype type: str or ~azure.ai.projects.models.GRAMMAR + :ivar syntax: The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. + Known values are: "lark" and "regex". + :vartype syntax: str or ~azure.ai.projects.models.GrammarSyntax1 + :ivar definition: The grammar definition. Required. + :vartype definition: str """ - blob_reference: "_models.BlobReference" = rest_field( - name="blobReference", visibility=["read", "create", "update", "delete", "query"] + type: Literal[CustomToolParamFormatType.GRAMMAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Grammar format. Always ``grammar``. Required. GRAMMAR.""" + syntax: Union[str, "_models.GrammarSyntax1"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Credential info to access the storage account. Required.""" + """The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. Known values are: + \"lark\" and \"regex\".""" + definition: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The grammar definition. Required.""" @overload def __init__( self, *, - blob_reference: "_models.BlobReference", + syntax: Union[str, "_models.GrammarSyntax1"], + definition: str, ) -> None: ... @overload @@ -5066,41 +5251,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CustomToolParamFormatType.GRAMMAR # type: ignore -class DatasetDataGenerationJobOutput(DataGenerationJobOutput, discriminator="dataset"): - """Dataset output for a data generation job. +class RoutineTrigger(_Model): + """Base model for a routine trigger. - :ivar type: Dataset output. Required. The generated data is a Dataset. - :vartype type: str or ~azure.ai.projects.models.DATASET - :ivar id: The id of the output dataset created. - :vartype id: str - :ivar name: The name of the output dataset. - :vartype name: str - :ivar version: The version of the output dataset. - :vartype version: str - :ivar description: Description of the output dataset. - :vartype description: str - :ivar tags: Tag dictionary of the output dataset. - :vartype tags: dict[str, str] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + CustomRoutineTrigger, GitHubIssueRoutineTrigger, ScheduleRoutineTrigger, TimerRoutineTrigger + + :ivar type: The trigger type. Required. Known values are: "custom", "github_issue", "schedule", + and "timer". + :vartype type: str or ~azure.ai.projects.models.RoutineTriggerType """ - type: Literal[DataGenerationJobOutputType.DATASET] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Dataset output. Required. The generated data is a Dataset.""" - id: Optional[str] = rest_field(visibility=["read"]) - """The id of the output dataset created.""" - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the output dataset.""" - version: Optional[str] = rest_field(visibility=["read"]) - """The version of the output dataset.""" - description: Optional[str] = rest_field(visibility=["read"]) - """Description of the output dataset.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read"]) - """Tag dictionary of the output dataset.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The trigger type. Required. Known values are: \"custom\", \"github_issue\", \"schedule\", and + \"timer\".""" @overload def __init__( self, + *, + type: str, ) -> None: ... @overload @@ -5112,43 +5286,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobOutputType.DATASET # type: ignore -class DatasetEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator="dataset"): - """Dataset source for evaluator generation jobs — reference to a dataset. +class CustomRoutineTrigger(RoutineTrigger, discriminator="custom"): + """A custom event routine trigger. - :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 Dataset. Required. Dataset source — - reference to a dataset. - :vartype type: str or ~azure.ai.projects.models.DATASET - :ivar name: The name of the dataset. Required. - :vartype name: str - :ivar version: The version of the dataset. If not specified, the latest version is used. - :vartype version: str + :ivar type: The trigger type. Required. A custom event trigger. + :vartype type: str or ~azure.ai.projects.models.CUSTOM + :ivar provider: The external provider that emits the custom event. Required. + :vartype provider: str + :ivar event_name: The provider-specific event name that fires the routine. + :vartype event_name: str + :ivar parameters: Provider-specific trigger parameters. Required. + :vartype parameters: dict[str, any] """ - 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.DATASET] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The source type for this source, which is Dataset. Required. Dataset source — reference to a - dataset.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the dataset. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version of the dataset. If not specified, the latest version is used.""" + type: Literal[RoutineTriggerType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The trigger type. Required. A custom event trigger.""" + provider: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The external provider that emits the custom event. Required.""" + event_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider-specific event name that fires the routine.""" + parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Provider-specific trigger parameters. Required.""" @overload def __init__( self, *, - name: str, - description: Optional[str] = None, - version: Optional[str] = None, + provider: str, + parameters: dict[str, Any], + event_name: Optional[str] = None, ) -> None: ... @overload @@ -5160,29 +5328,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorGenerationJobSourceType.DATASET # type: ignore + self.type = RoutineTriggerType.CUSTOM # type: ignore -class DatasetReference(_Model): - """Reference to a versioned Foundry Dataset. +class CustomTextFormatParam(CustomToolParamFormat, discriminator="text"): + """Text format. - :ivar name: Dataset name. Required. - :vartype name: str - :ivar version: Dataset version. Required. - :vartype version: str + :ivar type: Unconstrained text format. Always ``text``. Required. TEXT. + :vartype type: str or ~azure.ai.projects.models.TEXT """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset name. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset version. Required.""" + type: Literal[CustomToolParamFormatType.TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Unconstrained text format. Always ``text``. Required. TEXT.""" @overload def __init__( self, - *, - name: str, - version: str, ) -> None: ... @overload @@ -5194,69 +5355,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CustomToolParamFormatType.TEXT # type: ignore -class DatasetVersion(_Model): - """DatasetVersion Definition. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - FileDatasetVersion, FolderDatasetVersion +class CustomToolParam(Tool, discriminator="custom"): + """Custom tool. - :ivar data_uri: URI of the data (`example `_). - Required. - :vartype data_uri: str - :ivar type: Dataset type. Required. Known values are: "uri_file" and "uri_folder". - :vartype type: str or ~azure.ai.projects.models.DatasetType - :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset - manages storage itself. If true, the underlying data will not be deleted when the dataset - version is deleted. - :vartype is_reference: bool - :ivar connection_name: The Azure Storage Account connection name. Required if - startPendingUploadVersion was not called before creating the Dataset. - :vartype connection_name: str - :ivar id: Asset ID, a unique identifier for the asset. - :vartype id: str - :ivar name: The name of the resource. Required. + :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 version: The version of the resource. Required. - :vartype version: str - :ivar description: The asset description text. + :ivar description: Optional description of the custom tool, used to provide more context. :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, 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 """ - __mapping__: dict[str, _Model] = {} - data_uri: str = rest_field(name="dataUri", visibility=["read", "create"]) - """URI of the data (`example `_). Required.""" - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Dataset type. Required. Known values are: \"uri_file\" and \"uri_folder\".""" - is_reference: Optional[bool] = rest_field(name="isReference", visibility=["read"]) - """Indicates if the dataset holds a reference to the storage, or the dataset manages storage - itself. If true, the underlying data will not be deleted when the dataset version is deleted.""" - connection_name: Optional[str] = rest_field(name="connectionName", visibility=["read", "create"]) - """The Azure Storage Account connection name. Required if startPendingUploadVersion was not called - before creating the Dataset.""" - 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=["create", "update"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) - """Tag dictionary. Tags can be added, removed, and updated.""" + 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.""" + 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.""" @overload def __init__( self, *, - data_uri: str, - type: str, - connection_name: Optional[str] = None, + name: str, description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + format: Optional["_models.CustomToolParamFormat"] = None, + defer_loading: Optional[bool] = None, ) -> None: ... @overload @@ -5268,35 +5405,31 @@ 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 -class DeleteAgentResponse(_Model): - """A deleted agent Object. +class RecurrenceSchedule(_Model): + """Recurrence schedule model. - :ivar object: The object type. Always 'agent.deleted'. Required. AGENT_DELETED. - :vartype object: str or ~azure.ai.projects.models.AGENT_DELETED - :ivar name: The name of the agent. Required. - :vartype name: str - :ivar deleted: Whether the agent was successfully deleted. Required. - :vartype deleted: bool + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + DailyRecurrenceSchedule, HourlyRecurrenceSchedule, MonthlyRecurrenceSchedule, + WeeklyRecurrenceSchedule + + :ivar type: Recurrence type for the recurrence schedule. Required. Known values are: "Hourly", + "Daily", "Weekly", and "Monthly". + :vartype type: str or ~azure.ai.projects.models.RecurrenceType """ - object: Literal[AgentObjectType.AGENT_DELETED] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type. Always 'agent.deleted'. Required. AGENT_DELETED.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the agent. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the agent was successfully deleted. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Recurrence type for the recurrence schedule. Required. Known values are: \"Hourly\", \"Daily\", + \"Weekly\", and \"Monthly\".""" @overload def __init__( self, *, - object: Literal[AgentObjectType.AGENT_DELETED], - name: str, - deleted: bool, + type: str, ) -> None: ... @overload @@ -5310,38 +5443,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteAgentVersionResponse(_Model): - """A deleted agent version Object. +class DailyRecurrenceSchedule(RecurrenceSchedule, discriminator="Daily"): + """Daily recurrence schedule. - :ivar object: The object type. Always 'agent.version.deleted'. Required. AGENT_VERSION_DELETED. - :vartype object: str or ~azure.ai.projects.models.AGENT_VERSION_DELETED - :ivar name: The name of the agent. Required. - :vartype name: str - :ivar version: The version identifier of the agent. Required. - :vartype version: str - :ivar deleted: Whether the agent was successfully deleted. Required. - :vartype deleted: bool + :ivar type: Daily recurrence type. Required. Daily recurrence pattern. + :vartype type: str or ~azure.ai.projects.models.DAILY + :ivar hours: Hours for the recurrence schedule. Required. + :vartype hours: list[int] """ - object: Literal[AgentObjectType.AGENT_VERSION_DELETED] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type. Always 'agent.version.deleted'. Required. AGENT_VERSION_DELETED.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the agent. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version identifier of the agent. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the agent was successfully deleted. Required.""" + type: Literal[RecurrenceType.DAILY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Daily recurrence type. Required. Daily recurrence pattern.""" + hours: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Hours for the recurrence schedule. Required.""" @overload def __init__( self, *, - object: Literal[AgentObjectType.AGENT_VERSION_DELETED], - name: str, - version: str, - deleted: bool, + hours: list[int], ) -> None: ... @overload @@ -5353,35 +5473,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RecurrenceType.DAILY # type: ignore -class DeleteMemoryResult(_Model): - """Response for deleting a memory item from a memory store. +class DataGenerationJob(_Model): + """Data Generation Job resource. - :ivar object: The object type. Always 'memory_store.item.deleted'. Required. MEMORY_DELETED. - :vartype object: str or ~azure.ai.projects.models.MEMORY_DELETED - :ivar memory_id: The unique ID of the deleted memory item. Required. - :vartype memory_id: str - :ivar deleted: Whether the memory item was successfully deleted. Required. - :vartype deleted: bool + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: ~azure.ai.projects.models.DataGenerationJobInputs + :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 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 """ - object: Literal[MemoryStoreObjectType.MEMORY_DELETED] = rest_field( + id: str = rest_field(visibility=["read"]) + """Server-assigned unique identifier. Required.""" + inputs: Optional["_models.DataGenerationJobInputs"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The object type. Always 'memory_store.item.deleted'. Required. MEMORY_DELETED.""" - memory_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the deleted memory item. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the memory item was successfully deleted. Required.""" + """Caller-supplied inputs.""" + result: Optional["_models.DataGenerationJobResult"] = rest_field(visibility=["read"]) + """Result produced on success.""" + status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) + """Error details — populated only on failure.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was created, represented in Unix time (seconds since January 1, + 1970). Required.""" + finished_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was finished, represented in Unix time (seconds since January 1, + 1970).""" @overload def __init__( self, *, - object: Literal[MemoryStoreObjectType.MEMORY_DELETED], - memory_id: str, - deleted: bool, + inputs: Optional["_models.DataGenerationJobInputs"] = None, ) -> None: ... @overload @@ -5395,33 +5536,53 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteMemoryStoreResult(_Model): - """DeleteMemoryStoreResult. +class DataGenerationJobInputs(_Model): + """Caller-supplied inputs for a data generation job. - :ivar object: The object type. Always 'memory_store.deleted'. Required. MEMORY_STORE_DELETED. - :vartype object: str or ~azure.ai.projects.models.MEMORY_STORE_DELETED - :ivar name: The name of the memory store. Required. + :ivar name: The display name of the data generation job. Required. :vartype name: str - :ivar deleted: Whether the memory store was successfully deleted. Required. - :vartype deleted: bool + :ivar sources: The sources used for the data generation job. Required. + :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] + :ivar options: The options for the data generation job. Required. + :vartype options: ~azure.ai.projects.models.DataGenerationJobOptions + :ivar scenario: The scenario of the data generation job. Either for fine-tuning or evaluation. + Required. Known values are: "supervised_finetuning", "reinforcement_finetuning", and + "evaluation". + :vartype scenario: str or ~azure.ai.projects.models.DataGenerationJobScenario + :ivar output_options: Optional caller-supplied metadata for the job's output. See individual + fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs + (evaluation scenario), or both. + :vartype output_options: ~azure.ai.projects.models.DataGenerationJobOutputOptions """ - object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] = rest_field( + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The display name of the data generation job. Required.""" + sources: list["_models.DataGenerationJobSource"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The object type. Always 'memory_store.deleted'. Required. MEMORY_STORE_DELETED.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the memory store. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the memory store was successfully deleted. Required.""" + """The sources used for the data generation job. Required.""" + options: "_models.DataGenerationJobOptions" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The options for the data generation job. Required.""" + scenario: Union[str, "_models.DataGenerationJobScenario"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The scenario of the data generation job. Either for fine-tuning or evaluation. Required. Known + values are: \"supervised_finetuning\", \"reinforcement_finetuning\", and \"evaluation\".""" + output_options: Optional["_models.DataGenerationJobOutputOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional caller-supplied metadata for the job's output. See individual fields for whether they + apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both.""" @overload def __init__( self, *, - object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED], name: str, - deleted: bool, + sources: list["_models.DataGenerationJobSource"], + options: "_models.DataGenerationJobOptions", + scenario: Union[str, "_models.DataGenerationJobScenario"], + output_options: Optional["_models.DataGenerationJobOutputOptions"] = None, ) -> None: ... @overload @@ -5435,31 +5596,47 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteSkillResult(_Model): - """A deleted skill. +class DataGenerationJobOptions(_Model): + """Options for managing data generation jobs. - :ivar id: The unique identifier of the deleted skill. Required. - :vartype id: str - :ivar name: The unique name of the skill. Required. - :vartype name: str - :ivar deleted: Whether the skill was successfully deleted. Required. - :vartype deleted: bool + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + SimpleQnADataGenerationJobOptions, SimulationSeedDataGenerationJobOptions, + ToolUseFineTuningDataGenerationJobOptions, TracesDataGenerationJobOptions + + :ivar type: The data generation job type. Required. Known values are: "simple_qna", "traces", + "tool_use", and "simulation_seed". + :vartype type: str or ~azure.ai.projects.models.DataGenerationJobType + :ivar max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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 """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the deleted skill. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique name of the skill. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the skill was successfully deleted. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The data generation job type. Required. Known values are: \"simple_qna\", \"traces\", + \"tool_use\", and \"simulation_seed\".""" + max_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of samples to generate. Required.""" + train_split: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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.""" + model_options: Optional["_models.DataGenerationModelOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The LLM model options.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - name: str, - deleted: bool, + type: str, + max_samples: int, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, ) -> None: ... @overload @@ -5473,36 +5650,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteSkillVersionResult(_Model): - """A deleted skill version. +class DataGenerationJobOutput(_Model): + """Output information for a data generation job. - :ivar id: The unique identifier of the deleted skill version. Required. - :vartype id: str - :ivar name: The name of the skill. Required. - :vartype name: str - :ivar deleted: Whether the skill version was successfully deleted. Required. - :vartype deleted: bool - :ivar version: The version that was deleted. Required. - :vartype version: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + DatasetDataGenerationJobOutput, FileDataGenerationJobOutput + + :ivar type: The type of the output. Required. Known values are: "file" and "dataset". + :vartype type: str or ~azure.ai.projects.models.DataGenerationJobOutputType """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the deleted skill version. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the skill. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the skill version was successfully deleted. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version that was deleted. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of the output. Required. Known values are: \"file\" and \"dataset\".""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - name: str, - deleted: bool, - version: str, + type: str, ) -> None: ... @overload @@ -5516,29 +5682,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Deployment(_Model): - """Model Deployment Definition. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ModelDeployment +class DataGenerationJobOutputOptions(_Model): + """Output options for data generation job. - :ivar type: The type of the deployment. Required. "ModelDeployment" - :vartype type: str or ~azure.ai.projects.models.DeploymentType - :ivar name: Name of the deployment. Required. + :ivar name: Name to assign to the output. Used as the filename for Azure OpenAI file outputs + (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario). :vartype name: str + :ivar description: Description to assign to the output. Applies only to dataset outputs + (evaluation scenario); ignored for Azure OpenAI file outputs. + :vartype description: str + :ivar tags: Tags to assign to the output. Applies only to dataset outputs (evaluation + scenario); ignored for Azure OpenAI file outputs. + :vartype tags: dict[str, str] """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of the deployment. Required. \"ModelDeployment\"""" - name: str = rest_field(visibility=["read"]) - """Name of the deployment. Required.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning + scenarios) and as the dataset name for dataset outputs (evaluation scenario).""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description to assign to the output. Applies only to dataset outputs (evaluation scenario); + ignored for Azure OpenAI file outputs.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored + for Azure OpenAI file outputs.""" @overload def __init__( self, *, - type: str, + name: Optional[str] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -5552,54 +5726,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Dimension(_Model): - """A single dimension — one independent, measurable quality dimension within a rubric evaluator's - scoring blueprint. +class DataGenerationJobResult(_Model): + """Result produced by a successful data generation job. - :ivar id: Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). - Required. Provided by the user when manually creating a rubric evaluator or during - human-in-the-loop review of a generated set; the generation pipeline produces an initial value - the user can edit. Editable when saving new versions. Required. - :vartype id: str - :ivar description: What this dimension measures (e.g., 'Correctly identifies the user's - reservation intent and pursues the appropriate workflow'). Required. - :vartype description: str - :ivar weight: Relative weight of this dimension (1-10). The generation pipeline assigns exactly - one dimension weight 8-10; all others use 1-6. User edits are not constrained by this - heuristic. Required. - :vartype weight: int - :ivar always_applicable: When true, the LLM judge always scores this dimension regardless of - relevance (skips applicability assessment). The service-generated general quality/policy - dimension has this set to true and is non-editable. Users may set this on their own custom - dimensions. The service defaults to ``false`` if a value is not specified by the caller. - :vartype always_applicable: bool + :ivar outputs: The final job outputs: Azure OpenAI files for fine-tuning, or datasets for + evaluation. + :vartype outputs: list[~azure.ai.projects.models.DataGenerationJobOutput] + :ivar generated_samples: The number of samples actually generated. Required. + :vartype generated_samples: int + :ivar token_usage: The token usage information for the data generation job. + :vartype token_usage: ~azure.ai.projects.models.DataGenerationTokenUsage """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). Required. - Provided by the user when manually creating a rubric evaluator or during human-in-the-loop - review of a generated set; the generation pipeline produces an initial value the user can edit. - Editable when saving new versions. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and - pursues the appropriate workflow'). Required.""" - weight: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension - weight 8-10; all others use 1-6. User edits are not constrained by this heuristic. Required.""" - always_applicable: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """When true, the LLM judge always scores this dimension regardless of relevance (skips - applicability assessment). The service-generated general quality/policy dimension has this set - to true and is non-editable. Users may set this on their own custom dimensions. The service - defaults to ``false`` if a value is not specified by the caller.""" + outputs: Optional[list["_models.DataGenerationJobOutput"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation.""" + generated_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of samples actually generated. Required.""" + token_usage: Optional["_models.DataGenerationTokenUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The token usage information for the data generation job.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - description: str, - weight: int, - always_applicable: Optional[bool] = None, + generated_samples: int, + outputs: Optional[list["_models.DataGenerationJobOutput"]] = None, + token_usage: Optional["_models.DataGenerationTokenUsage"] = None, ) -> None: ... @overload @@ -5613,31 +5769,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DispatchRoutineResult(_Model): - """Identifiers returned after a routine dispatch is queued. +class DataGenerationModelOptions(_Model): + """LLM model options for data generation jobs. - :ivar dispatch_id: The dispatch identifier created for the routine dispatch. - :vartype dispatch_id: str - :ivar action_correlation_id: A downstream action correlation identifier, when available. - :vartype action_correlation_id: str - :ivar task_id: A workspace task identifier created for the dispatch, when available. - :vartype task_id: str + :ivar model: Base model name used to generate data. Required. + :vartype model: str """ - dispatch_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The dispatch identifier created for the routine dispatch.""" - action_correlation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A downstream action correlation identifier, when available.""" - task_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A workspace task identifier created for the dispatch, when available.""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base model name used to generate data. Required.""" @overload def __init__( self, *, - dispatch_id: Optional[str] = None, - action_correlation_id: Optional[str] = None, - task_id: Optional[str] = None, + model: str, ) -> None: ... @overload @@ -5651,87 +5797,42 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EmbeddingConfiguration(_Model): - """Embedding configuration class. +class DataGenerationTokenUsage(_Model): + """Token usage information for a data generation job. - :ivar model_deployment_name: Deployment name of embedding model. It can point to a model - deployment either in the parent AIServices or a connection. Required. - :vartype model_deployment_name: str - :ivar embedding_field: Embedding field. Required. - :vartype embedding_field: str + :ivar prompt_tokens: The number of prompt tokens used. Required. + :vartype prompt_tokens: int + :ivar completion_tokens: The number of completion tokens generated. Required. + :vartype completion_tokens: int + :ivar total_tokens: Total number of tokens used. Required. + :vartype total_tokens: int """ - model_deployment_name: str = rest_field(name="modelDeploymentName", visibility=["create"]) - """Deployment name of embedding model. It can point to a model deployment either in the parent - AIServices or a connection. Required.""" - embedding_field: str = rest_field(name="embeddingField", visibility=["create"]) - """Embedding field. Required.""" - - @overload - def __init__( - self, - *, - model_deployment_name: str, - embedding_field: 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 EmptyModelParam(_Model): - """EmptyModelParam.""" + prompt_tokens: int = rest_field(visibility=["read"]) + """The number of prompt tokens used. Required.""" + completion_tokens: int = rest_field(visibility=["read"]) + """The number of completion tokens generated. Required.""" + total_tokens: int = rest_field(visibility=["read"]) + """Total number of tokens used. Required.""" -class EndpointBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="endpoint"): - """Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that - implements the evaluation contract. The evaluator references a Project Connection by name; the - connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, - the service resolves the connection to obtain the endpoint URL and authentication details, then - calls the endpoint for each evaluation row. +class DatasetCredential(_Model): + """Represents a reference to a blob for consumption. - :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. Endpoint-based evaluator definition. References a customer-owned HTTP - endpoint via a Project Connection. - :vartype type: str or ~azure.ai.projects.models.ENDPOINT - :ivar connection_name: Name of the Project Connection that stores the endpoint URL and - credentials. The connection must exist on the project and have a non-empty target URL. - Supported auth types: ApiKey (sends ``api-key`` header) and AAD/Entra ID (acquires a bearer - token via the project's Managed Identity). Required. - :vartype connection_name: str + :ivar blob_reference: Credential info to access the storage account. Required. + :vartype blob_reference: ~azure.ai.projects.models.BlobReference """ - type: Literal[EvaluatorDefinitionType.ENDPOINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Endpoint-based evaluator definition. References a customer-owned HTTP endpoint via a - Project Connection.""" - connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the Project Connection that stores the endpoint URL and credentials. The connection - must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends - ``api-key`` header) and AAD/Entra ID (acquires a bearer token via the project's Managed - Identity). Required.""" + blob_reference: "_models.BlobReference" = rest_field( + name="blobReference", visibility=["read", "create", "update", "delete", "query"] + ) + """Credential info to access the storage account. Required.""" @overload def __init__( self, *, - connection_name: str, - init_parameters: Optional[dict[str, Any]] = None, - data_schema: Optional[dict[str, Any]] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, + blob_reference: "_models.BlobReference", ) -> None: ... @overload @@ -5743,18 +5844,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorDefinitionType.ENDPOINT # type: ignore -class EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="Entra"): - """EntraAuthorizationScheme. +class DatasetDataGenerationJobOutput(DataGenerationJobOutput, discriminator="dataset"): + """Dataset output for a data generation job. - :ivar type: Required. ENTRA. - :vartype type: str or ~azure.ai.projects.models.ENTRA + :ivar type: Dataset output. Required. The generated data is a Dataset. + :vartype type: str or ~azure.ai.projects.models.DATASET + :ivar id: The id of the output dataset created. + :vartype id: str + :ivar name: The name of the output dataset. + :vartype name: str + :ivar version: The version of the output dataset. + :vartype version: str + :ivar description: Description of the output dataset. + :vartype description: str + :ivar tags: Tag dictionary of the output dataset. + :vartype tags: dict[str, str] """ - type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. ENTRA.""" + type: Literal[DataGenerationJobOutputType.DATASET] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset output. Required. The generated data is a Dataset.""" + id: Optional[str] = rest_field(visibility=["read"]) + """The id of the output dataset created.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the output dataset.""" + version: Optional[str] = rest_field(visibility=["read"]) + """The version of the output dataset.""" + description: Optional[str] = rest_field(visibility=["read"]) + """Description of the output dataset.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read"]) + """Tag dictionary of the output dataset.""" @overload def __init__( @@ -5770,22 +5890,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentEndpointAuthorizationSchemeType.ENTRA # type: ignore + self.type = DataGenerationJobOutputType.DATASET # type: ignore -class EntraIDCredentials(BaseCredentials, discriminator="AAD"): - """Entra ID credential definition. +class DatasetEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator="dataset"): + """Dataset source for evaluator generation jobs — reference to a dataset. - :ivar type: The credential type. Required. Entra ID credential (formerly known as AAD). - :vartype type: str or ~azure.ai.projects.models.ENTRA_ID + :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 Dataset. Required. Dataset source — + reference to a dataset. + :vartype type: str or ~azure.ai.projects.models.DATASET + :ivar name: The name of the dataset. Required. + :vartype name: str + :ivar version: The version of the dataset. If not specified, the latest version is used. + :vartype version: str """ - type: Literal[CredentialType.ENTRA_ID] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. Entra ID credential (formerly known as AAD).""" + 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.DATASET] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The source type for this source, which is Dataset. Required. Dataset source — reference to a + dataset.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the dataset. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the dataset. If not specified, the latest version is used.""" @overload def __init__( self, + *, + name: str, + description: Optional[str] = None, + version: Optional[str] = None, ) -> None: ... @overload @@ -5797,39 +5938,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.ENTRA_ID # type: ignore + self.type = EvaluatorGenerationJobSourceType.DATASET # type: ignore -class EvalResult(_Model): - """Result of the evaluation. +class DatasetReference(_Model): + """Reference to a versioned Foundry Dataset. - :ivar name: name of the check. Required. + :ivar name: Dataset name. Required. :vartype name: str - :ivar type: type of the check. Required. - :vartype type: str - :ivar score: score. Required. - :vartype score: float - :ivar passed: indicates if the check passed or failed. Required. - :vartype passed: bool + :ivar version: Dataset version. Required. + :vartype version: str """ name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """name of the check. Required.""" - type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """type of the check. Required.""" - score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """score. Required.""" - passed: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """indicates if the check passed or failed. Required.""" + """Dataset name. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Dataset version. Required.""" @overload def __init__( self, *, name: str, - type: str, - score: float, - passed: bool, + version: str, ) -> None: ... @overload @@ -5843,49 +5974,67 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvalRunResultCompareItem(_Model): - """Metric comparison for a treatment against the baseline. +class DatasetVersion(_Model): + """DatasetVersion Definition. - :ivar treatment_run_id: The treatment run ID. Required. - :vartype treatment_run_id: str - :ivar treatment_run_summary: Summary statistics of the treatment run. Required. - :vartype treatment_run_summary: ~azure.ai.projects.models.EvalRunResultSummary - :ivar delta_estimate: Estimated difference between treatment and baseline. Required. - :vartype delta_estimate: float - :ivar p_value: P-value for the treatment effect. Required. - :vartype p_value: float - :ivar treatment_effect: Type of treatment effect. Required. Known values are: "TooFewSamples", - "Inconclusive", "Changed", "Improved", and "Degraded". - :vartype treatment_effect: str or ~azure.ai.projects.models.TreatmentEffectType - """ + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + FileDatasetVersion, FolderDatasetVersion - treatment_run_id: str = rest_field( - name="treatmentRunId", visibility=["read", "create", "update", "delete", "query"] - ) - """The treatment run ID. Required.""" - treatment_run_summary: "_models.EvalRunResultSummary" = rest_field( - name="treatmentRunSummary", visibility=["read", "create", "update", "delete", "query"] - ) - """Summary statistics of the treatment run. Required.""" - delta_estimate: float = rest_field(name="deltaEstimate", visibility=["read", "create", "update", "delete", "query"]) - """Estimated difference between treatment and baseline. Required.""" - p_value: float = rest_field(name="pValue", visibility=["read", "create", "update", "delete", "query"]) - """P-value for the treatment effect. Required.""" - treatment_effect: Union[str, "_models.TreatmentEffectType"] = rest_field( - name="treatmentEffect", visibility=["read", "create", "update", "delete", "query"] - ) - """Type of treatment effect. Required. Known values are: \"TooFewSamples\", \"Inconclusive\", - \"Changed\", \"Improved\", and \"Degraded\".""" + :ivar data_uri: URI of the data (`example `_). + Required. + :vartype data_uri: str + :ivar type: Dataset type. Required. Known values are: "uri_file" and "uri_folder". + :vartype type: str or ~azure.ai.projects.models.DatasetType + :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset + manages storage itself. If true, the underlying data will not be deleted when the dataset + version is deleted. + :vartype is_reference: bool + :ivar connection_name: The Azure Storage Account connection name. Required if + startPendingUploadVersion was not called before creating the Dataset. + :vartype connection_name: str + :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] + """ + + __mapping__: dict[str, _Model] = {} + data_uri: str = rest_field(name="dataUri", visibility=["read", "create"]) + """URI of the data (`example `_). Required.""" + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Dataset type. Required. Known values are: \"uri_file\" and \"uri_folder\".""" + is_reference: Optional[bool] = rest_field(name="isReference", visibility=["read"]) + """Indicates if the dataset holds a reference to the storage, or the dataset manages storage + itself. If true, the underlying data will not be deleted when the dataset version is deleted.""" + connection_name: Optional[str] = rest_field(name="connectionName", visibility=["read", "create"]) + """The Azure Storage Account connection name. Required if startPendingUploadVersion was not called + before creating the Dataset.""" + 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=["create", "update"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) + """Tag dictionary. Tags can be added, removed, and updated.""" @overload def __init__( self, *, - treatment_run_id: str, - treatment_run_summary: "_models.EvalRunResultSummary", - delta_estimate: float, - p_value: float, - treatment_effect: Union[str, "_models.TreatmentEffectType"], + data_uri: str, + type: str, + connection_name: Optional[str] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -5899,47 +6048,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvalRunResultComparison(_Model): - """Comparison results for treatment runs against the baseline. +class DeleteAgentResponse(_Model): + """A deleted agent Object. - :ivar testing_criteria: Name of the testing criteria. Required. - :vartype testing_criteria: str - :ivar metric: Metric being evaluated. Required. - :vartype metric: str - :ivar evaluator: Name of the evaluator for this testing criteria. Required. - :vartype evaluator: str - :ivar baseline_run_summary: Summary statistics of the baseline run. Required. - :vartype baseline_run_summary: ~azure.ai.projects.models.EvalRunResultSummary - :ivar compare_items: List of comparison results for each treatment run. Required. - :vartype compare_items: list[~azure.ai.projects.models.EvalRunResultCompareItem] + :ivar object: The object type. Always 'agent.deleted'. Required. AGENT_DELETED. + :vartype object: str or ~azure.ai.projects.models.AGENT_DELETED + :ivar name: The name of the agent. Required. + :vartype name: str + :ivar deleted: Whether the agent was successfully deleted. Required. + :vartype deleted: bool """ - testing_criteria: str = rest_field( - name="testingCriteria", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the testing criteria. Required.""" - metric: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metric being evaluated. Required.""" - evaluator: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the evaluator for this testing criteria. Required.""" - baseline_run_summary: "_models.EvalRunResultSummary" = rest_field( - name="baselineRunSummary", visibility=["read", "create", "update", "delete", "query"] - ) - """Summary statistics of the baseline run. Required.""" - compare_items: list["_models.EvalRunResultCompareItem"] = rest_field( - name="compareItems", visibility=["read", "create", "update", "delete", "query"] + object: Literal[AgentObjectType.AGENT_DELETED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """List of comparison results for each treatment run. Required.""" + """The object type. Always 'agent.deleted'. Required. AGENT_DELETED.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the agent. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the agent was successfully deleted. Required.""" @overload def __init__( self, *, - testing_criteria: str, - metric: str, - evaluator: str, - baseline_run_summary: "_models.EvalRunResultSummary", - compare_items: list["_models.EvalRunResultCompareItem"], + object: Literal[AgentObjectType.AGENT_DELETED], + name: str, + deleted: bool, ) -> None: ... @overload @@ -5953,38 +6088,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvalRunResultSummary(_Model): - """Summary statistics of a metric in an evaluation run. +class DeleteAgentVersionResponse(_Model): + """A deleted agent version Object. - :ivar run_id: The evaluation run ID. Required. - :vartype run_id: str - :ivar sample_count: Number of samples in the evaluation run. Required. - :vartype sample_count: int - :ivar average: Average value of the metric in the evaluation run. Required. - :vartype average: float - :ivar standard_deviation: Standard deviation of the metric in the evaluation run. Required. - :vartype standard_deviation: float + :ivar object: The object type. Always 'agent.version.deleted'. Required. AGENT_VERSION_DELETED. + :vartype object: str or ~azure.ai.projects.models.AGENT_VERSION_DELETED + :ivar name: The name of the agent. Required. + :vartype name: str + :ivar version: The version identifier of the agent. Required. + :vartype version: str + :ivar deleted: Whether the agent was successfully deleted. Required. + :vartype deleted: bool """ - run_id: str = rest_field(name="runId", visibility=["read", "create", "update", "delete", "query"]) - """The evaluation run ID. Required.""" - sample_count: int = rest_field(name="sampleCount", visibility=["read", "create", "update", "delete", "query"]) - """Number of samples in the evaluation run. Required.""" - average: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Average value of the metric in the evaluation run. Required.""" - standard_deviation: float = rest_field( - name="standardDeviation", visibility=["read", "create", "update", "delete", "query"] + object: Literal[AgentObjectType.AGENT_VERSION_DELETED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Standard deviation of the metric in the evaluation run. Required.""" + """The object type. Always 'agent.version.deleted'. Required. AGENT_VERSION_DELETED.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the agent. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version identifier of the agent. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the agent was successfully deleted. Required.""" @overload def __init__( self, *, - run_id: str, - sample_count: int, - average: float, - standard_deviation: float, + object: Literal[AgentObjectType.AGENT_VERSION_DELETED], + name: str, + version: str, + deleted: bool, ) -> None: ... @overload @@ -5998,37 +6133,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationComparisonInsightRequest(InsightRequest, discriminator="EvaluationComparison"): - """Evaluation Comparison Request. +class DeleteMemoryResult(_Model): + """Response for deleting a memory item from a memory store. - :ivar type: The type of request. Required. Evaluation Comparison. - :vartype type: str or ~azure.ai.projects.models.EVALUATION_COMPARISON - :ivar eval_id: Identifier for the evaluation. Required. - :vartype eval_id: str - :ivar baseline_run_id: The baseline run ID for comparison. Required. - :vartype baseline_run_id: str - :ivar treatment_run_ids: List of treatment run IDs for comparison. Required. - :vartype treatment_run_ids: list[str] + :ivar object: The object type. Always 'memory_store.item.deleted'. Required. MEMORY_DELETED. + :vartype object: str or ~azure.ai.projects.models.MEMORY_DELETED + :ivar memory_id: The unique ID of the deleted memory item. Required. + :vartype memory_id: str + :ivar deleted: Whether the memory item was successfully deleted. Required. + :vartype deleted: bool """ - type: Literal[InsightType.EVALUATION_COMPARISON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of request. Required. Evaluation Comparison.""" - eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the evaluation. Required.""" - baseline_run_id: str = rest_field(name="baselineRunId", visibility=["read", "create", "update", "delete", "query"]) - """The baseline run ID for comparison. Required.""" - treatment_run_ids: list[str] = rest_field( - name="treatmentRunIds", visibility=["read", "create", "update", "delete", "query"] + object: Literal[MemoryStoreObjectType.MEMORY_DELETED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """List of treatment run IDs for comparison. Required.""" + """The object type. Always 'memory_store.item.deleted'. Required. MEMORY_DELETED.""" + memory_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the deleted memory item. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the memory item was successfully deleted. Required.""" @overload def __init__( self, *, - eval_id: str, - baseline_run_id: str, - treatment_run_ids: list[str], + object: Literal[MemoryStoreObjectType.MEMORY_DELETED], + memory_id: str, + deleted: bool, ) -> None: ... @overload @@ -6040,35 +6171,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = InsightType.EVALUATION_COMPARISON # type: ignore -class EvaluationComparisonInsightResult(InsightResult, discriminator="EvaluationComparison"): - """Insights from the evaluation comparison. +class DeleteMemoryStoreResult(_Model): + """DeleteMemoryStoreResult. - :ivar type: The type of insights result. Required. Evaluation Comparison. - :vartype type: str or ~azure.ai.projects.models.EVALUATION_COMPARISON - :ivar comparisons: Comparison results for each treatment run against the baseline. Required. - :vartype comparisons: list[~azure.ai.projects.models.EvalRunResultComparison] - :ivar method: The statistical method used for comparison. Required. - :vartype method: str + :ivar object: The object type. Always 'memory_store.deleted'. Required. MEMORY_STORE_DELETED. + :vartype object: str or ~azure.ai.projects.models.MEMORY_STORE_DELETED + :ivar name: The name of the memory store. Required. + :vartype name: str + :ivar deleted: Whether the memory store was successfully deleted. Required. + :vartype deleted: bool """ - type: Literal[InsightType.EVALUATION_COMPARISON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of insights result. Required. Evaluation Comparison.""" - comparisons: list["_models.EvalRunResultComparison"] = rest_field( + object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Comparison results for each treatment run against the baseline. Required.""" - method: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The statistical method used for comparison. Required.""" + """The object type. Always 'memory_store.deleted'. Required. MEMORY_STORE_DELETED.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the memory store. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the memory store was successfully deleted. Required.""" @overload def __init__( self, *, - comparisons: list["_models.EvalRunResultComparison"], - method: str, + object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED], + name: str, + deleted: bool, ) -> None: ... @overload @@ -6080,45 +6211,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = InsightType.EVALUATION_COMPARISON # type: ignore -class InsightSample(_Model): - """A sample from the analysis. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - EvaluationResultSample +class DeleteSkillResult(_Model): + """A deleted skill. - :ivar id: The unique identifier for the analysis sample. Required. + :ivar id: The unique identifier of the deleted skill. Required. :vartype id: str - :ivar type: Sample type. Required. "EvaluationResultSample" - :vartype type: str or ~azure.ai.projects.models.SampleType - :ivar features: Features to help with additional filtering of data in UX. Required. - :vartype features: dict[str, any] - :ivar correlation_info: Info about the correlation for the analysis sample. Required. - :vartype correlation_info: dict[str, any] + :ivar name: The unique name of the skill. Required. + :vartype name: str + :ivar deleted: Whether the skill was successfully deleted. Required. + :vartype deleted: bool """ - __mapping__: dict[str, _Model] = {} id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier for the analysis sample. Required.""" - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Sample type. Required. \"EvaluationResultSample\"""" - features: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Features to help with additional filtering of data in UX. Required.""" - correlation_info: dict[str, Any] = rest_field( - name="correlationInfo", visibility=["read", "create", "update", "delete", "query"] - ) - """Info about the correlation for the analysis sample. Required.""" + """The unique identifier of the deleted skill. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique name of the skill. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the skill was successfully deleted. Required.""" @overload def __init__( self, *, id: str, # pylint: disable=redefined-builtin - type: str, - features: dict[str, Any], - correlation_info: dict[str, Any], + name: str, + deleted: bool, ) -> None: ... @overload @@ -6132,36 +6251,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationResultSample(InsightSample, discriminator="EvaluationResultSample"): - """A sample from the evaluation result. +class DeleteSkillVersionResult(_Model): + """A deleted skill version. - :ivar id: The unique identifier for the analysis sample. Required. + :ivar id: The unique identifier of the deleted skill version. Required. :vartype id: str - :ivar features: Features to help with additional filtering of data in UX. Required. - :vartype features: dict[str, any] - :ivar correlation_info: Info about the correlation for the analysis sample. Required. - :vartype correlation_info: dict[str, any] - :ivar type: Evaluation Result Sample Type. Required. A sample from the evaluation result. - :vartype type: str or ~azure.ai.projects.models.EVALUATION_RESULT_SAMPLE - :ivar evaluation_result: Evaluation result for the analysis sample. Required. - :vartype evaluation_result: ~azure.ai.projects.models.EvalResult + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar deleted: Whether the skill version was successfully deleted. Required. + :vartype deleted: bool + :ivar version: The version that was deleted. Required. + :vartype version: str """ - type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Evaluation Result Sample Type. Required. A sample from the evaluation result.""" - evaluation_result: "_models.EvalResult" = rest_field( - name="evaluationResult", visibility=["read", "create", "update", "delete", "query"] - ) - """Evaluation result for the analysis sample. Required.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the deleted skill version. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the skill version was successfully deleted. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version that was deleted. Required.""" @overload def __init__( self, *, id: str, # pylint: disable=redefined-builtin - features: dict[str, Any], - correlation_info: dict[str, Any], - evaluation_result: "_models.EvalResult", + name: str, + deleted: bool, + version: str, ) -> None: ... @overload @@ -6173,65 +6292,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = SampleType.EVALUATION_RESULT_SAMPLE # type: ignore -class EvaluationRule(_Model): - """Evaluation rule model. +class Deployment(_Model): + """Model Deployment Definition. - :ivar id: Unique identifier for the evaluation rule. Required. - :vartype id: str - :ivar display_name: Display Name for the evaluation rule. - :vartype display_name: str - :ivar description: Description for the evaluation rule. - :vartype description: str - :ivar action: Definition of the evaluation rule action. Required. - :vartype action: ~azure.ai.projects.models.EvaluationRuleAction - :ivar filter: Filter condition of the evaluation rule. - :vartype filter: ~azure.ai.projects.models.EvaluationRuleFilter - :ivar event_type: Event type that the evaluation rule applies to. Required. Known values are: - "responseCompleted" and "manual". - :vartype event_type: str or ~azure.ai.projects.models.EvaluationRuleEventType - :ivar enabled: Indicates whether the evaluation rule is enabled. Default is true. Required. - :vartype enabled: bool - :ivar system_data: System metadata for the evaluation rule. Required. - :vartype system_data: dict[str, str] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ModelDeployment + + :ivar type: The type of the deployment. Required. "ModelDeployment" + :vartype type: str or ~azure.ai.projects.models.DeploymentType + :ivar name: Name of the deployment. Required. + :vartype name: str """ - id: str = rest_field(visibility=["read"]) - """Unique identifier for the evaluation rule. Required.""" - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """Display Name for the evaluation rule.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description for the evaluation rule.""" - action: "_models.EvaluationRuleAction" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Definition of the evaluation rule action. Required.""" - filter: Optional["_models.EvaluationRuleFilter"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Filter condition of the evaluation rule.""" - event_type: Union[str, "_models.EvaluationRuleEventType"] = rest_field( - name="eventType", visibility=["read", "create", "update", "delete", "query"] - ) - """Event type that the evaluation rule applies to. Required. Known values are: - \"responseCompleted\" and \"manual\".""" - enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates whether the evaluation rule is enabled. Default is true. Required.""" - system_data: dict[str, str] = rest_field(name="systemData", visibility=["read"]) - """System metadata for the evaluation rule. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of the deployment. Required. \"ModelDeployment\"""" + name: str = rest_field(visibility=["read"]) + """Name of the deployment. Required.""" @overload def __init__( self, *, - action: "_models.EvaluationRuleAction", - event_type: Union[str, "_models.EvaluationRuleEventType"], - enabled: bool, - display_name: Optional[str] = None, - description: Optional[str] = None, - filter: Optional["_models.EvaluationRuleFilter"] = None, # pylint: disable=redefined-builtin + type: str, ) -> None: ... @overload @@ -6245,21 +6330,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationRuleFilter(_Model): - """Evaluation filter model. +class Dimension(_Model): + """A single dimension — one independent, measurable quality dimension within a rubric evaluator's + scoring blueprint. - :ivar agent_name: Filter by agent name. Required. - :vartype agent_name: str + :ivar id: Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). + Required. Provided by the user when manually creating a rubric evaluator or during + human-in-the-loop review of a generated set; the generation pipeline produces an initial value + the user can edit. Editable when saving new versions. Required. + :vartype id: str + :ivar description: What this dimension measures (e.g., 'Correctly identifies the user's + reservation intent and pursues the appropriate workflow'). Required. + :vartype description: str + :ivar weight: Relative weight of this dimension (1-10). The generation pipeline assigns exactly + one dimension weight 8-10; all others use 1-6. User edits are not constrained by this + heuristic. Required. + :vartype weight: int + :ivar always_applicable: When true, the LLM judge always scores this dimension regardless of + relevance (skips applicability assessment). The service-generated general quality/policy + dimension has this set to true and is non-editable. Users may set this on their own custom + dimensions. The service defaults to ``false`` if a value is not specified by the caller. + :vartype always_applicable: bool """ - agent_name: str = rest_field(name="agentName", visibility=["read", "create", "update", "delete", "query"]) - """Filter by agent name. Required.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). Required. + Provided by the user when manually creating a rubric evaluator or during human-in-the-loop + review of a generated set; the generation pipeline produces an initial value the user can edit. + Editable when saving new versions. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and + pursues the appropriate workflow'). Required.""" + weight: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension + weight 8-10; all others use 1-6. User edits are not constrained by this heuristic. Required.""" + always_applicable: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """When true, the LLM judge always scores this dimension regardless of relevance (skips + applicability assessment). The service-generated general quality/policy dimension has this set + to true and is non-editable. Users may set this on their own custom dimensions. The service + defaults to ``false`` if a value is not specified by the caller.""" @overload def __init__( self, *, - agent_name: str, + id: str, # pylint: disable=redefined-builtin + description: str, + weight: int, + always_applicable: Optional[bool] = None, ) -> None: ... @overload @@ -6273,37 +6391,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationRunClusterInsightRequest(InsightRequest, discriminator="EvaluationRunClusterInsight"): - """Insights on set of Evaluation Results. +class DispatchRoutineResult(_Model): + """Identifiers returned after a routine dispatch is queued. - :ivar type: The type of insights request. Required. Insights on an Evaluation run result. - :vartype type: str or ~azure.ai.projects.models.EVALUATION_RUN_CLUSTER_INSIGHT - :ivar eval_id: Evaluation Id for the insights. Required. - :vartype eval_id: str - :ivar run_ids: List of evaluation run IDs for the insights. Required. - :vartype run_ids: list[str] - :ivar model_configuration: Configuration of the model used in the insight generation. - :vartype model_configuration: ~azure.ai.projects.models.InsightModelConfiguration + :ivar dispatch_id: The dispatch identifier created for the routine dispatch. + :vartype dispatch_id: str + :ivar action_correlation_id: A downstream action correlation identifier, when available. + :vartype action_correlation_id: str + :ivar task_id: A workspace task identifier created for the dispatch, when available. + :vartype task_id: str """ - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of insights request. Required. Insights on an Evaluation run result.""" - eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) - """Evaluation Id for the insights. Required.""" - run_ids: list[str] = rest_field(name="runIds", visibility=["read", "create", "update", "delete", "query"]) - """List of evaluation run IDs for the insights. Required.""" - model_configuration: Optional["_models.InsightModelConfiguration"] = rest_field( - name="modelConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration of the model used in the insight generation.""" + dispatch_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The dispatch identifier created for the routine dispatch.""" + action_correlation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A downstream action correlation identifier, when available.""" + task_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A workspace task identifier created for the dispatch, when available.""" @overload def __init__( self, *, - eval_id: str, - run_ids: list[str], - model_configuration: Optional["_models.InsightModelConfiguration"] = None, + dispatch_id: Optional[str] = None, + action_correlation_id: Optional[str] = None, + task_id: Optional[str] = None, ) -> None: ... @overload @@ -6315,30 +6427,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class EvaluationRunClusterInsightResult(InsightResult, discriminator="EvaluationRunClusterInsight"): - """Insights from the evaluation run cluster analysis. +class EmbeddingConfiguration(_Model): + """Embedding configuration class. - :ivar type: The type of insights result. Required. Insights on an Evaluation run result. - :vartype type: str or ~azure.ai.projects.models.EVALUATION_RUN_CLUSTER_INSIGHT - :ivar cluster_insight: Required. - :vartype cluster_insight: ~azure.ai.projects.models.ClusterInsightResult + :ivar model_deployment_name: Deployment name of embedding model. It can point to a model + deployment either in the parent AIServices or a connection. Required. + :vartype model_deployment_name: str + :ivar embedding_field: Embedding field. Required. + :vartype embedding_field: str """ - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of insights result. Required. Insights on an Evaluation run result.""" - cluster_insight: "_models.ClusterInsightResult" = rest_field( - name="clusterInsight", visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" + model_deployment_name: str = rest_field(name="modelDeploymentName", visibility=["create"]) + """Deployment name of embedding model. It can point to a model deployment either in the parent + AIServices or a connection. Required.""" + embedding_field: str = rest_field(name="embeddingField", visibility=["create"]) + """Embedding field. Required.""" @overload def __init__( self, *, - cluster_insight: "_models.ClusterInsightResult", + model_deployment_name: str, + embedding_field: str, ) -> None: ... @overload @@ -6350,33 +6462,54 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class ScheduleTask(_Model): - """Schedule task model. +class EmptyModelParam(_Model): + """EmptyModelParam.""" - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - EvaluationScheduleTask, InsightScheduleTask - :ivar type: Type of the task. Required. Known values are: "Evaluation" and "Insight". - :vartype type: str or ~azure.ai.projects.models.ScheduleTaskType - :ivar configuration: Configuration for the task. - :vartype configuration: dict[str, str] - """ +class EndpointBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="endpoint"): + """Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that + implements the evaluation contract. The evaluator references a Project Connection by name; the + connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, + the service resolves the connection to obtain the endpoint URL and authentication details, then + calls the endpoint for each evaluation row. - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of the task. Required. Known values are: \"Evaluation\" and \"Insight\".""" - configuration: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Configuration for the task.""" + :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. Endpoint-based evaluator definition. References a customer-owned HTTP + endpoint via a Project Connection. + :vartype type: str or ~azure.ai.projects.models.ENDPOINT + :ivar connection_name: Name of the Project Connection that stores the endpoint URL and + credentials. The connection must exist on the project and have a non-empty target URL. + Supported auth types: ApiKey (sends ``api-key`` header) and AAD/Entra ID (acquires a bearer + token via the project's Managed Identity). Required. + :vartype connection_name: str + """ + + type: Literal[EvaluatorDefinitionType.ENDPOINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Endpoint-based evaluator definition. References a customer-owned HTTP endpoint via a + Project Connection.""" + connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the Project Connection that stores the endpoint URL and credentials. The connection + must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends + ``api-key`` header) and AAD/Entra ID (acquires a bearer token via the project's Managed + Identity). Required.""" @overload def __init__( self, *, - type: str, - configuration: Optional[dict[str, str]] = None, + connection_name: str, + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, ) -> None: ... @overload @@ -6388,35 +6521,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = EvaluatorDefinitionType.ENDPOINT # type: ignore -class EvaluationScheduleTask(ScheduleTask, discriminator="Evaluation"): - """Evaluation task for the schedule. +class EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="Entra"): + """EntraAuthorizationScheme. - :ivar configuration: Configuration for the task. - :vartype configuration: dict[str, str] - :ivar type: Required. Evaluation task. - :vartype type: str or ~azure.ai.projects.models.EVALUATION - :ivar eval_id: Identifier of the evaluation group. Required. - :vartype eval_id: str - :ivar eval_run: The evaluation run payload. Required. - :vartype eval_run: dict[str, any] + :ivar type: Required. ENTRA. + :vartype type: str or ~azure.ai.projects.models.ENTRA """ - type: Literal[ScheduleTaskType.EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Evaluation task.""" - eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) - """Identifier of the evaluation group. Required.""" - eval_run: dict[str, Any] = rest_field(name="evalRun", visibility=["read", "create", "update", "delete", "query"]) - """The evaluation run payload. Required.""" + type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. ENTRA.""" @overload def __init__( self, - *, - eval_id: str, - eval_run: dict[str, Any], - configuration: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -6428,60 +6548,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ScheduleTaskType.EVALUATION # type: ignore + self.type = AgentEndpointAuthorizationSchemeType.ENTRA # type: ignore -class EvaluationTaxonomy(_Model): - """Evaluation Taxonomy Definition. +class EntraIDCredentials(BaseCredentials, discriminator="AAD"): + """Entra ID credential definition. - :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 taxonomy_input: Input configuration for the evaluation taxonomy. Required. - :vartype taxonomy_input: ~azure.ai.projects.models.EvaluationTaxonomyInput - :ivar taxonomy_categories: List of taxonomy categories. - :vartype taxonomy_categories: list[~azure.ai.projects.models.TaxonomyCategory] - :ivar properties: Additional properties for the evaluation taxonomy. - :vartype properties: dict[str, str] + :ivar type: The credential type. Required. Entra ID credential (formerly known as AAD). + :vartype type: str or ~azure.ai.projects.models.ENTRA_ID """ - 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=["create", "update"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) - """Tag dictionary. Tags can be added, removed, and updated.""" - taxonomy_input: "_models.EvaluationTaxonomyInput" = rest_field( - name="taxonomyInput", visibility=["read", "create", "update", "delete", "query"] - ) - """Input configuration for the evaluation taxonomy. Required.""" - taxonomy_categories: Optional[list["_models.TaxonomyCategory"]] = rest_field( - name="taxonomyCategories", visibility=["read", "create", "update", "delete", "query"] - ) - """List of taxonomy categories.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Additional properties for the evaluation taxonomy.""" + type: Literal[CredentialType.ENTRA_ID] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. Entra ID credential (formerly known as AAD).""" @overload def __init__( self, - *, - taxonomy_input: "_models.EvaluationTaxonomyInput", - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - taxonomy_categories: Optional[list["_models.TaxonomyCategory"]] = None, - properties: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -6493,25 +6575,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CredentialType.ENTRA_ID # type: ignore -class EvaluatorCredentialRequest(_Model): - """Request body for getting evaluator credentials. +class EvalResult(_Model): + """Result of the evaluation. - :ivar blob_uri: The blob URI for the evaluator storage. Example: - ``https://account.blob.core.windows.net:443/container``. Required. - :vartype blob_uri: str + :ivar name: name of the check. Required. + :vartype name: str + :ivar type: type of the check. Required. + :vartype type: str + :ivar score: score. Required. + :vartype score: float + :ivar passed: indicates if the check passed or failed. Required. + :vartype passed: bool """ - blob_uri: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The blob URI for the evaluator storage. Example: - ``https://account.blob.core.windows.net:443/container``. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """name of the check. Required.""" + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """type of the check. Required.""" + score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """score. Required.""" + passed: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """indicates if the check passed or failed. Required.""" @overload def __init__( self, *, - blob_uri: str, + name: str, + type: str, + score: float, + passed: bool, ) -> None: ... @overload @@ -6525,42 +6621,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationArtifacts(_Model): - """Service-managed provenance artifacts produced by an evaluator generation job. Present only on - EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry - Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace. +class EvalRunResultCompareItem(_Model): + """Metric comparison for a treatment against the baseline. - :ivar dataset: Reference to the single Foundry Dataset (one combined JSONL file, - version-aligned to ``EvaluatorVersion.version``) holding all artifacts produced by the - generation pipeline. Each row in the JSONL carries a ``kind`` field discriminating its content - (e.g. ``spec``, ``tools``, ``context``). Required. - :vartype dataset: ~azure.ai.projects.models.DatasetReference - :ivar kinds: The kinds of rows present in ``dataset``. Always contains ``"spec"`` (the - generated evaluation specification, a Markdown document describing what the evaluator - measures). May additionally contain ``"tools"`` (when the generation pipeline produced or - inferred OpenAI tool schemas) and/or ``"context"`` (when supplementary materials such as file - uploads or trace samples were used during generation). Required. - :vartype kinds: list[str] + :ivar treatment_run_id: The treatment run ID. Required. + :vartype treatment_run_id: str + :ivar treatment_run_summary: Summary statistics of the treatment run. Required. + :vartype treatment_run_summary: ~azure.ai.projects.models.EvalRunResultSummary + :ivar delta_estimate: Estimated difference between treatment and baseline. Required. + :vartype delta_estimate: float + :ivar p_value: P-value for the treatment effect. Required. + :vartype p_value: float + :ivar treatment_effect: Type of treatment effect. Required. Known values are: "TooFewSamples", + "Inconclusive", "Changed", "Improved", and "Degraded". + :vartype treatment_effect: str or ~azure.ai.projects.models.TreatmentEffectType """ - dataset: "_models.DatasetReference" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to - ``EvaluatorVersion.version``) holding all artifacts produced by the generation pipeline. Each - row in the JSONL carries a ``kind`` field discriminating its content (e.g. ``spec``, ``tools``, - ``context``). Required.""" - kinds: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The kinds of rows present in ``dataset``. Always contains ``\"spec\"`` (the generated - evaluation specification, a Markdown document describing what the evaluator measures). May - additionally contain ``\"tools\"`` (when the generation pipeline produced or inferred OpenAI - tool schemas) and/or ``\"context\"`` (when supplementary materials such as file uploads or - trace samples were used during generation). Required.""" + treatment_run_id: str = rest_field( + name="treatmentRunId", visibility=["read", "create", "update", "delete", "query"] + ) + """The treatment run ID. Required.""" + treatment_run_summary: "_models.EvalRunResultSummary" = rest_field( + name="treatmentRunSummary", visibility=["read", "create", "update", "delete", "query"] + ) + """Summary statistics of the treatment run. Required.""" + delta_estimate: float = rest_field(name="deltaEstimate", visibility=["read", "create", "update", "delete", "query"]) + """Estimated difference between treatment and baseline. Required.""" + p_value: float = rest_field(name="pValue", visibility=["read", "create", "update", "delete", "query"]) + """P-value for the treatment effect. Required.""" + treatment_effect: Union[str, "_models.TreatmentEffectType"] = rest_field( + name="treatmentEffect", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of treatment effect. Required. Known values are: \"TooFewSamples\", \"Inconclusive\", + \"Changed\", \"Improved\", and \"Degraded\".""" @overload def __init__( self, *, - dataset: "_models.DatasetReference", - kinds: list[str], + treatment_run_id: str, + treatment_run_summary: "_models.EvalRunResultSummary", + delta_estimate: float, + p_value: float, + treatment_effect: Union[str, "_models.TreatmentEffectType"], ) -> None: ... @overload @@ -6574,76 +6677,47 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationInputs(_Model): - """Caller-supplied inputs for an evaluator generation job. - - :ivar sources: Source materials for generation — agent descriptions, prompts, traces, or - datasets. Each entry is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. - Required. - :vartype sources: list[~azure.ai.projects.models.EvaluatorGenerationJobSource] - :ivar model: The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must - provide their own model rather than relying on service-owned capacity. Required. - :vartype model: str - :ivar evaluator_name: The evaluator name (immutable identifier). 1-256 characters; allowed - characters are ASCII letters, digits, underscore (``_``), period (``.``), tilde (``~``), and - hyphen (``-``). The prefix ``builtin.`` is reserved for system-managed evaluators and is - rejected by the service. If an evaluator with this name already exists in the project (and is - rubric-subtype), the service creates a new version under the same name and uses the prior - version's ``dimensions`` as context for incremental improvement (foundation of the post-//build - adaptive loop). Old versions remain queryable via ``get_version(name, version)``. If the - existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the - request is rejected with ``400 Bad Request``. Required. - :vartype evaluator_name: str - :ivar evaluator_display_name: Optional human-friendly display name for the resulting evaluator. - Surfaced as ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the - service uses ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates - this from the immutable ``evaluator_name`` identifier. - :vartype evaluator_display_name: str - :ivar evaluator_description: Optional human-friendly description for the resulting evaluator. - Surfaced as ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected - from the UI alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this - from any other description fields on related models. - :vartype evaluator_description: str - """ +class EvalRunResultComparison(_Model): + """Comparison results for treatment runs against the baseline. - sources: list["_models.EvaluatorGenerationJobSource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry - is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. Required.""" - model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide - their own model rather than relying on service-owned capacity. Required.""" - evaluator_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII - letters, digits, underscore (``_``), period (``.``), tilde (``~``), and hyphen (``-``). The - prefix ``builtin.`` is reserved for system-managed evaluators and is rejected by the service. - If an evaluator with this name already exists in the project (and is rubric-subtype), the - service creates a new version under the same name and uses the prior version's ``dimensions`` - as context for incremental improvement (foundation of the post-//build adaptive loop). Old - versions remain queryable via ``get_version(name, version)``. If the existing evaluator is not - a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with - ``400 Bad Request``. Required.""" - evaluator_display_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional human-friendly display name for the resulting evaluator. Surfaced as - ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the service uses - ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates this from the - immutable ``evaluator_name`` identifier.""" - evaluator_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional human-friendly description for the resulting evaluator. Surfaced as - ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected from the UI - alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this from any - other description fields on related models.""" + :ivar testing_criteria: Name of the testing criteria. Required. + :vartype testing_criteria: str + :ivar metric: Metric being evaluated. Required. + :vartype metric: str + :ivar evaluator: Name of the evaluator for this testing criteria. Required. + :vartype evaluator: str + :ivar baseline_run_summary: Summary statistics of the baseline run. Required. + :vartype baseline_run_summary: ~azure.ai.projects.models.EvalRunResultSummary + :ivar compare_items: List of comparison results for each treatment run. Required. + :vartype compare_items: list[~azure.ai.projects.models.EvalRunResultCompareItem] + """ + + testing_criteria: str = rest_field( + name="testingCriteria", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the testing criteria. Required.""" + metric: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Metric being evaluated. Required.""" + evaluator: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the evaluator for this testing criteria. Required.""" + baseline_run_summary: "_models.EvalRunResultSummary" = rest_field( + name="baselineRunSummary", visibility=["read", "create", "update", "delete", "query"] + ) + """Summary statistics of the baseline run. Required.""" + compare_items: list["_models.EvalRunResultCompareItem"] = rest_field( + name="compareItems", visibility=["read", "create", "update", "delete", "query"] + ) + """List of comparison results for each treatment run. Required.""" @overload def __init__( self, *, - sources: list["_models.EvaluatorGenerationJobSource"], - model: str, - evaluator_name: str, - evaluator_display_name: Optional[str] = None, - evaluator_description: Optional[str] = None, + testing_criteria: str, + metric: str, + evaluator: str, + baseline_run_summary: "_models.EvalRunResultSummary", + compare_items: list["_models.EvalRunResultCompareItem"], ) -> None: ... @overload @@ -6657,70 +6731,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationJob(_Model): - """Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator - definitions from source materials. On success, the result is the persisted EvaluatorVersion. +class EvalRunResultSummary(_Model): + """Summary statistics of a metric in an evaluation run. - :ivar id: Server-assigned unique identifier. Required. - :vartype id: str - :ivar inputs: Caller-supplied inputs. - :vartype inputs: ~azure.ai.projects.models.EvaluatorGenerationInputs - :ivar result: Result produced on success. - :vartype result: ~azure.ai.projects.models.EvaluatorVersion - :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 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 finished, represented in Unix time (seconds since - January 1, 1970). - :vartype finished_at: ~datetime.datetime - :ivar usage: Token consumption summary. Populated when the job reaches a terminal state. - :vartype usage: ~azure.ai.projects.models.EvaluatorGenerationTokenUsage - :ivar input_quality_warnings: Non-fatal input-quality advisories produced by the generation - pipeline. Read-only; service-generated; populated only on terminal jobs when advisories fired. - Omitted when generation was clean. Cleared when a subsequent ``PATCH`` to the paired - ``EvaluatorVersion.definition`` invalidates the advisories. - :vartype input_quality_warnings: - list[~azure.ai.projects.models.RubricGenerationInputQualityWarning] + :ivar run_id: The evaluation run ID. Required. + :vartype run_id: str + :ivar sample_count: Number of samples in the evaluation run. Required. + :vartype sample_count: int + :ivar average: Average value of the metric in the evaluation run. Required. + :vartype average: float + :ivar standard_deviation: Standard deviation of the metric in the evaluation run. Required. + :vartype standard_deviation: float """ - id: str = rest_field(visibility=["read"]) - """Server-assigned unique identifier. Required.""" - inputs: Optional["_models.EvaluatorGenerationInputs"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Caller-supplied inputs.""" - result: Optional["_models.EvaluatorVersion"] = rest_field(visibility=["read"]) - """Result produced on success.""" - status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) - """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", - \"succeeded\", \"failed\", and \"cancelled\".""" - error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) - """Error details — populated only on failure.""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was created, represented in Unix time (seconds since January 1, - 1970). Required.""" - finished_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).""" - usage: Optional["_models.EvaluatorGenerationTokenUsage"] = rest_field(visibility=["read"]) - """Token consumption summary. Populated when the job reaches a terminal state.""" - input_quality_warnings: Optional[list["_models.RubricGenerationInputQualityWarning"]] = rest_field( - visibility=["read"] + run_id: str = rest_field(name="runId", visibility=["read", "create", "update", "delete", "query"]) + """The evaluation run ID. Required.""" + sample_count: int = rest_field(name="sampleCount", visibility=["read", "create", "update", "delete", "query"]) + """Number of samples in the evaluation run. Required.""" + average: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Average value of the metric in the evaluation run. Required.""" + standard_deviation: float = rest_field( + name="standardDeviation", visibility=["read", "create", "update", "delete", "query"] ) - """Non-fatal input-quality advisories produced by the generation pipeline. Read-only; - service-generated; populated only on terminal jobs when advisories fired. Omitted when - generation was clean. Cleared when a subsequent ``PATCH`` to the paired - ``EvaluatorVersion.definition`` invalidates the advisories.""" + """Standard deviation of the metric in the evaluation run. Required.""" @overload def __init__( self, *, - inputs: Optional["_models.EvaluatorGenerationInputs"] = None, + run_id: str, + sample_count: int, + average: float, + standard_deviation: float, ) -> None: ... @overload @@ -6734,32 +6776,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationTokenUsage(_Model): - """Token consumption summary for an evaluator generation job. Populated when the job reaches a - terminal state. +class EvaluationComparisonInsightRequest(InsightRequest, discriminator="EvaluationComparison"): + """Evaluation Comparison Request. - :ivar input_tokens: Number of input (prompt) tokens consumed. Required. - :vartype input_tokens: int - :ivar output_tokens: Number of output (completion) tokens generated. Required. - :vartype output_tokens: int - :ivar total_tokens: Total tokens consumed (input + output). Required. - :vartype total_tokens: int + :ivar type: The type of request. Required. Evaluation Comparison. + :vartype type: str or ~azure.ai.projects.models.EVALUATION_COMPARISON + :ivar eval_id: Identifier for the evaluation. Required. + :vartype eval_id: str + :ivar baseline_run_id: The baseline run ID for comparison. Required. + :vartype baseline_run_id: str + :ivar treatment_run_ids: List of treatment run IDs for comparison. Required. + :vartype treatment_run_ids: list[str] """ - input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of input (prompt) tokens consumed. Required.""" - output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of output (completion) tokens generated. Required.""" - total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Total tokens consumed (input + output). Required.""" + type: Literal[InsightType.EVALUATION_COMPARISON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of request. Required. Evaluation Comparison.""" + eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the evaluation. Required.""" + baseline_run_id: str = rest_field(name="baselineRunId", visibility=["read", "create", "update", "delete", "query"]) + """The baseline run ID for comparison. Required.""" + treatment_run_ids: list[str] = rest_field( + name="treatmentRunIds", visibility=["read", "create", "update", "delete", "query"] + ) + """List of treatment run IDs for comparison. Required.""" @overload def __init__( self, *, - input_tokens: int, - output_tokens: int, - total_tokens: int, + eval_id: str, + baseline_run_id: str, + treatment_run_ids: list[str], ) -> None: ... @overload @@ -6771,54 +6818,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = InsightType.EVALUATION_COMPARISON # type: ignore -class EvaluatorMetric(_Model): - """Evaluator Metric. +class EvaluationComparisonInsightResult(InsightResult, discriminator="EvaluationComparison"): + """Insights from the evaluation comparison. - :ivar type: Type of the metric. Known values are: "ordinal", "continuous", and "boolean". - :vartype type: str or ~azure.ai.projects.models.EvaluatorMetricType - :ivar desirable_direction: It indicates whether a higher value is better or a lower value is - better for this metric. Known values are: "increase", "decrease", and "neutral". - :vartype desirable_direction: str or ~azure.ai.projects.models.EvaluatorMetricDirection - :ivar min_value: Minimum value for the metric. - :vartype min_value: float - :ivar max_value: Maximum value for the metric. If not specified, it is assumed to be unbounded. - :vartype max_value: float - :ivar threshold: Default pass/fail threshold for this metric. - :vartype threshold: float - :ivar is_primary: Indicates if this metric is primary when there are multiple metrics. - :vartype is_primary: bool + :ivar type: The type of insights result. Required. Evaluation Comparison. + :vartype type: str or ~azure.ai.projects.models.EVALUATION_COMPARISON + :ivar comparisons: Comparison results for each treatment run against the baseline. Required. + :vartype comparisons: list[~azure.ai.projects.models.EvalRunResultComparison] + :ivar method: The statistical method used for comparison. Required. + :vartype method: str """ - type: Optional[Union[str, "_models.EvaluatorMetricType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Type of the metric. Known values are: \"ordinal\", \"continuous\", and \"boolean\".""" - desirable_direction: Optional[Union[str, "_models.EvaluatorMetricDirection"]] = rest_field( + type: Literal[InsightType.EVALUATION_COMPARISON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of insights result. Required. Evaluation Comparison.""" + comparisons: list["_models.EvalRunResultComparison"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """It indicates whether a higher value is better or a lower value is better for this metric. Known - values are: \"increase\", \"decrease\", and \"neutral\".""" - min_value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Minimum value for the metric.""" - max_value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum value for the metric. If not specified, it is assumed to be unbounded.""" - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Default pass/fail threshold for this metric.""" - is_primary: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates if this metric is primary when there are multiple metrics.""" + """Comparison results for each treatment run against the baseline. Required.""" + method: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The statistical method used for comparison. Required.""" @overload def __init__( self, *, - type: Optional[Union[str, "_models.EvaluatorMetricType"]] = None, - desirable_direction: Optional[Union[str, "_models.EvaluatorMetricDirection"]] = None, - min_value: Optional[float] = None, - max_value: Optional[float] = None, - threshold: Optional[float] = None, - is_primary: Optional[bool] = None, + comparisons: list["_models.EvalRunResultComparison"], + method: str, ) -> None: ... @overload @@ -6830,124 +6858,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = InsightType.EVALUATION_COMPARISON # type: ignore -class EvaluatorVersion(_Model): - """Evaluator Definition. +class InsightSample(_Model): + """A sample from the analysis. - :ivar display_name: Display Name for evaluator. It helps to find the evaluator easily in AI - Foundry. It does not need to be unique. - :vartype display_name: str - :ivar metadata: Metadata about the evaluator. - :vartype metadata: dict[str, str] - :ivar evaluator_type: The type of the evaluator. Required. Known values are: "builtin" and - "custom". - :vartype evaluator_type: str or ~azure.ai.projects.models.EvaluatorType - :ivar categories: The categories of the evaluator. Required. - :vartype categories: list[str or ~azure.ai.projects.models.EvaluatorCategory] - :ivar supported_evaluation_levels: Evaluation levels this evaluator supports (e.g., ``turn``, - ``conversation``). When omitted on create, the service defaults to ``["turn"]``. On update, - omitting this field leaves it unchanged; an empty list is rejected. Custom code-based - evaluators support only ``turn``; custom prompt-based evaluators support exactly one level - (``turn`` or ``conversation``). - :vartype supported_evaluation_levels: list[str or ~azure.ai.projects.models.EvaluationLevel] - :ivar definition: Definition of the evaluator. Required. - :vartype definition: ~azure.ai.projects.models.EvaluatorDefinition - :ivar generation_artifacts: Provenance artifacts from the generation pipeline. Read-only; - present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact - resolves to a versioned Foundry Dataset. - :vartype generation_artifacts: ~azure.ai.projects.models.EvaluatorGenerationArtifacts - :ivar generation_job_id: Read-only provenance link back to the EvaluatorGenerationJob that - produced this version. Present only on evaluator versions created via the generation pipeline; - absent for manually-created versions and unaffected by subsequent ``PATCH`` calls. - :vartype generation_job_id: str - :ivar warnings: Categories of warnings surfaced on this generated evaluator version. Present - only on versions created via an EvaluatorGenerationJob when the paired job produced non-empty - warnings. Absent (treat as no warnings) when the version is not from generation, when the - paired job was clean, or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's - advisories. Follow ``generation_job_id`` to fetch the detailed warning payloads. - :vartype warnings: list[str or ~azure.ai.projects.models.GenerationWarningType] - :ivar created_by: Creator of the evaluator. Required. - :vartype created_by: str - :ivar created_at: Creation date/time of the evaluator. Required. - :vartype created_at: ~datetime.datetime - :ivar modified_at: Last modified date/time of the evaluator. Required. - :vartype modified_at: ~datetime.datetime - :ivar id: Asset ID, a unique identifier for the asset. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + EvaluationResultSample + + :ivar id: The unique identifier for the analysis sample. Required. :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: Sample type. Required. "EvaluationResultSample" + :vartype type: str or ~azure.ai.projects.models.SampleType + :ivar features: Features to help with additional filtering of data in UX. Required. + :vartype features: dict[str, any] + :ivar correlation_info: Info about the correlation for the analysis sample. Required. + :vartype correlation_info: dict[str, any] """ - display_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not - need to be unique.""" - metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metadata about the evaluator.""" - evaluator_type: Union[str, "_models.EvaluatorType"] = rest_field(visibility=["read", "create"]) - """The type of the evaluator. Required. Known values are: \"builtin\" and \"custom\".""" - categories: list[Union[str, "_models.EvaluatorCategory"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The categories of the evaluator. Required.""" - supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + __mapping__: dict[str, _Model] = {} + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier for the analysis sample. Required.""" + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Sample type. Required. \"EvaluationResultSample\"""" + features: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Features to help with additional filtering of data in UX. Required.""" + correlation_info: dict[str, Any] = rest_field( + name="correlationInfo", visibility=["read", "create", "update", "delete", "query"] ) - """Evaluation levels this evaluator supports (e.g., ``turn``, ``conversation``). When omitted on - create, the service defaults to ``[\"turn\"]``. On update, omitting this field leaves it - unchanged; an empty list is rejected. Custom code-based evaluators support only ``turn``; - custom prompt-based evaluators support exactly one level (``turn`` or ``conversation``).""" - definition: "_models.EvaluatorDefinition" = rest_field(visibility=["read", "create"]) - """Definition of the evaluator. Required.""" - generation_artifacts: Optional["_models.EvaluatorGenerationArtifacts"] = rest_field(visibility=["read"]) - """Provenance artifacts from the generation pipeline. Read-only; present only on evaluator - versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry - Dataset.""" - generation_job_id: Optional[str] = rest_field(visibility=["read"]) - """Read-only provenance link back to the EvaluatorGenerationJob that produced this version. - Present only on evaluator versions created via the generation pipeline; absent for - manually-created versions and unaffected by subsequent ``PATCH`` calls.""" - warnings: Optional[list[Union[str, "_models.GenerationWarningType"]]] = rest_field(visibility=["read"]) - """Categories of warnings surfaced on this generated evaluator version. Present only on versions - created via an EvaluatorGenerationJob when the paired job produced non-empty warnings. Absent - (treat as no warnings) when the version is not from generation, when the paired job was clean, - or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's advisories. Follow - ``generation_job_id`` to fetch the detailed warning payloads.""" - created_by: str = rest_field(visibility=["read"]) - """Creator of the evaluator. Required.""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="rfc3339") - """Creation date/time of the evaluator. Required.""" - modified_at: datetime.datetime = rest_field(visibility=["read"], format="rfc3339") - """Last modified date/time of the evaluator. Required.""" - 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=["create", "update"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) - """Tag dictionary. Tags can be added, removed, and updated.""" + """Info about the correlation for the analysis sample. Required.""" @overload def __init__( self, *, - evaluator_type: Union[str, "_models.EvaluatorType"], - categories: list[Union[str, "_models.EvaluatorCategory"]], - definition: "_models.EvaluatorDefinition", - display_name: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = None, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + id: str, # pylint: disable=redefined-builtin + type: str, + features: dict[str, Any], + correlation_info: dict[str, Any], ) -> None: ... @overload @@ -6961,40 +6910,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ExternalAgentDefinition(AgentDefinition, discriminator="external"): - """The external agent definition. Represents a third-party agent hosted outside Foundry (for - example, on GCP or AWS). Registration is metadata-only: Foundry records the agent definition to - light up observability experiences (traces, evaluations) over customer-emitted OpenTelemetry - data. +class EvaluationResultSample(InsightSample, discriminator="EvaluationResultSample"): + """A sample from the evaluation result. - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig - :ivar kind: Required. EXTERNAL. - :vartype kind: str or ~azure.ai.projects.models.EXTERNAL - :ivar otel_agent_id: The OpenTelemetry agent identifier used to attribute customer-emitted - spans to this Foundry agent. Spans must include the attribute ``gen_ai.agent.id = - `` to appear under this registration. Defaults to the top-level agent name when - omitted. Provide an explicit value only for migration scenarios where the running external - agent already emits a stable id that differs from the Foundry agent name. The resolved value is - always echoed on read. - :vartype otel_agent_id: str + :ivar id: The unique identifier for the analysis sample. Required. + :vartype id: str + :ivar features: Features to help with additional filtering of data in UX. Required. + :vartype features: dict[str, any] + :ivar correlation_info: Info about the correlation for the analysis sample. Required. + :vartype correlation_info: dict[str, any] + :ivar type: Evaluation Result Sample Type. Required. A sample from the evaluation result. + :vartype type: str or ~azure.ai.projects.models.EVALUATION_RESULT_SAMPLE + :ivar evaluation_result: Evaluation result for the analysis sample. Required. + :vartype evaluation_result: ~azure.ai.projects.models.EvalResult """ - kind: Literal[AgentKind.EXTERNAL] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. EXTERNAL.""" - otel_agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry - agent. Spans must include the attribute ``gen_ai.agent.id = `` to appear under - this registration. Defaults to the top-level agent name when omitted. Provide an explicit value - only for migration scenarios where the running external agent already emits a stable id that - differs from the Foundry agent name. The resolved value is always echoed on read.""" + type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Evaluation Result Sample Type. Required. A sample from the evaluation result.""" + evaluation_result: "_models.EvalResult" = rest_field( + name="evaluationResult", visibility=["read", "create", "update", "delete", "query"] + ) + """Evaluation result for the analysis sample. Required.""" @overload def __init__( self, *, - rai_config: Optional["_models.RaiConfig"] = None, - otel_agent_id: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + features: dict[str, Any], + correlation_info: dict[str, Any], + evaluation_result: "_models.EvalResult", ) -> None: ... @overload @@ -7006,28 +6951,65 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = AgentKind.EXTERNAL # type: ignore + self.type = SampleType.EVALUATION_RESULT_SAMPLE # type: ignore -class FabricDataAgentToolParameters(_Model): - """The fabric data agent tool parameters. +class EvaluationRule(_Model): + """Evaluation rule model. - :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 id: Unique identifier for the evaluation rule. Required. + :vartype id: str + :ivar display_name: Display Name for the evaluation rule. + :vartype display_name: str + :ivar description: Description for the evaluation rule. + :vartype description: str + :ivar action: Definition of the evaluation rule action. Required. + :vartype action: ~azure.ai.projects.models.EvaluationRuleAction + :ivar filter: Filter condition of the evaluation rule. + :vartype filter: ~azure.ai.projects.models.EvaluationRuleFilter + :ivar event_type: Event type that the evaluation rule applies to. Required. Known values are: + "responseCompleted" and "manual". + :vartype event_type: str or ~azure.ai.projects.models.EvaluationRuleEventType + :ivar enabled: Indicates whether the evaluation rule is enabled. Default is true. Required. + :vartype enabled: bool + :ivar system_data: System metadata for the evaluation rule. Required. + :vartype system_data: dict[str, str] """ - project_connections: Optional[list["_models.ToolProjectConnection"]] = rest_field( + id: str = rest_field(visibility=["read"]) + """Unique identifier for the evaluation rule. Required.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] + ) + """Display Name for the evaluation rule.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description for the evaluation rule.""" + action: "_models.EvaluationRuleAction" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Definition of the evaluation rule action. Required.""" + filter: Optional["_models.EvaluationRuleFilter"] = 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.""" + """Filter condition of the evaluation rule.""" + event_type: Union[str, "_models.EvaluationRuleEventType"] = rest_field( + name="eventType", visibility=["read", "create", "update", "delete", "query"] + ) + """Event type that the evaluation rule applies to. Required. Known values are: + \"responseCompleted\" and \"manual\".""" + enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates whether the evaluation rule is enabled. Default is true. Required.""" + system_data: dict[str, str] = rest_field(name="systemData", visibility=["read"]) + """System metadata for the evaluation rule. Required.""" @overload def __init__( self, *, - project_connections: Optional[list["_models.ToolProjectConnection"]] = None, + action: "_models.EvaluationRuleAction", + event_type: Union[str, "_models.EvaluationRuleEventType"], + enabled: bool, + display_name: Optional[str] = None, + description: Optional[str] = None, + filter: Optional["_models.EvaluationRuleFilter"] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -7041,46 +7023,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FabricIQPreviewTool(Tool, discriminator="fabric_iq_preview"): - """A FabricIQ server-side tool. +class EvaluationRuleFilter(_Model): + """Evaluation filter model. - :ivar type: The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.FABRIC_IQ_PREVIEW - :ivar project_connection_id: The ID of the FabricIQ project connection. Required. - :vartype project_connection_id: str - :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. - :vartype server_label: str - :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from - the project connection will be used. - :vartype server_url: str - :ivar require_approval: (Optional) Whether the agent requires approval before executing - actions. Default is always. Is either a MCPToolRequireApproval type or a str type. - :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str + :ivar agent_name: Filter by agent name. Required. + :vartype agent_name: str """ - type: Literal[ToolType.FABRIC_IQ_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW.""" - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the FabricIQ project connection. Required.""" - server_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """(Optional) The label of the FabricIQ MCP server to connect to.""" - server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project - connection will be used.""" - require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """(Optional) Whether the agent requires approval before executing actions. Default is always. Is - either a MCPToolRequireApproval type or a str type.""" + agent_name: str = rest_field(name="agentName", visibility=["read", "create", "update", "delete", "query"]) + """Filter by agent name. Required.""" @overload def __init__( self, *, - project_connection_id: str, - server_label: Optional[str] = None, - server_url: Optional[str] = None, - require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = None, + agent_name: str, ) -> None: ... @overload @@ -7092,60 +7049,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.FABRIC_IQ_PREVIEW # type: ignore -class FabricIQPreviewToolboxTool(ToolboxTool, discriminator="fabric_iq_preview"): - """A FabricIQ tool stored in a toolbox. +class EvaluationRunClusterInsightRequest(InsightRequest, discriminator="EvaluationRunClusterInsight"): + """Insights on set of Evaluation Results. - :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. FABRIC_IQ_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.FABRIC_IQ_PREVIEW - :ivar project_connection_id: The ID of the FabricIQ project connection. Required. - :vartype project_connection_id: str - :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. - :vartype server_label: str - :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from - the project connection will be used. - :vartype server_url: str - :ivar require_approval: (Optional) Whether the agent requires approval before executing - actions. Default is always. Is either a MCPToolRequireApproval type or a str type. - :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str + :ivar type: The type of insights request. Required. Insights on an Evaluation run result. + :vartype type: str or ~azure.ai.projects.models.EVALUATION_RUN_CLUSTER_INSIGHT + :ivar eval_id: Evaluation Id for the insights. Required. + :vartype eval_id: str + :ivar run_ids: List of evaluation run IDs for the insights. Required. + :vartype run_ids: list[str] + :ivar model_configuration: Configuration of the model used in the insight generation. + :vartype model_configuration: ~azure.ai.projects.models.InsightModelConfiguration """ - type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FABRIC_IQ_PREVIEW.""" - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the FabricIQ project connection. Required.""" - server_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """(Optional) The label of the FabricIQ MCP server to connect to.""" - server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project - connection will be used.""" - require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of insights request. Required. Insights on an Evaluation run result.""" + eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) + """Evaluation Id for the insights. Required.""" + run_ids: list[str] = rest_field(name="runIds", visibility=["read", "create", "update", "delete", "query"]) + """List of evaluation run IDs for the insights. Required.""" + model_configuration: Optional["_models.InsightModelConfiguration"] = rest_field( + name="modelConfiguration", visibility=["read", "create", "update", "delete", "query"] ) - """(Optional) Whether the agent requires approval before executing actions. Default is always. Is - either a MCPToolRequireApproval type or a str type.""" + """Configuration of the model used in the insight generation.""" @overload def __init__( self, *, - project_connection_id: str, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - server_label: Optional[str] = None, - server_url: Optional[str] = None, - require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = None, + eval_id: str, + run_ids: list[str], + model_configuration: Optional["_models.InsightModelConfiguration"] = None, ) -> None: ... @overload @@ -7157,49 +7093,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.FABRIC_IQ_PREVIEW # type: ignore + self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class FieldMapping(_Model): - """Field mapping configuration class. +class EvaluationRunClusterInsightResult(InsightResult, discriminator="EvaluationRunClusterInsight"): + """Insights from the evaluation run cluster analysis. - :ivar content_fields: List of fields with text content. Required. - :vartype content_fields: list[str] - :ivar filepath_field: Path of file to be used as a source of text content. - :vartype filepath_field: str - :ivar title_field: Field containing the title of the document. - :vartype title_field: str - :ivar url_field: Field containing the url of the document. - :vartype url_field: str - :ivar vector_fields: List of fields with vector content. - :vartype vector_fields: list[str] - :ivar metadata_fields: List of fields with metadata content. - :vartype metadata_fields: list[str] + :ivar type: The type of insights result. Required. Insights on an Evaluation run result. + :vartype type: str or ~azure.ai.projects.models.EVALUATION_RUN_CLUSTER_INSIGHT + :ivar cluster_insight: Required. + :vartype cluster_insight: ~azure.ai.projects.models.ClusterInsightResult """ - content_fields: list[str] = rest_field(name="contentFields", visibility=["create"]) - """List of fields with text content. Required.""" - filepath_field: Optional[str] = rest_field(name="filepathField", visibility=["create"]) - """Path of file to be used as a source of text content.""" - title_field: Optional[str] = rest_field(name="titleField", visibility=["create"]) - """Field containing the title of the document.""" - url_field: Optional[str] = rest_field(name="urlField", visibility=["create"]) - """Field containing the url of the document.""" - vector_fields: Optional[list[str]] = rest_field(name="vectorFields", visibility=["create"]) - """List of fields with vector content.""" - metadata_fields: Optional[list[str]] = rest_field(name="metadataFields", visibility=["create"]) - """List of fields with metadata content.""" + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of insights result. Required. Insights on an Evaluation run result.""" + cluster_insight: "_models.ClusterInsightResult" = rest_field( + name="clusterInsight", visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" @overload def __init__( self, *, - content_fields: list[str], - filepath_field: Optional[str] = None, - title_field: Optional[str] = None, - url_field: Optional[str] = None, - vector_fields: Optional[list[str]] = None, - metadata_fields: Optional[list[str]] = None, + cluster_insight: "_models.ClusterInsightResult", ) -> None: ... @overload @@ -7211,29 +7128,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class FileDataGenerationJobOutput(DataGenerationJobOutput, discriminator="file"): - """Azure OpenAI file output for a data generation job. +class ScheduleTask(_Model): + """Schedule task model. - :ivar type: Azure OpenAI file output. Required. The generated data is an Azure OpenAI File. - :vartype type: str or ~azure.ai.projects.models.FILE - :ivar id: The id of the output Azure OpenAI file. Required. - :vartype id: str - :ivar filename: The filename of the output Azure OpenAI file. Required. - :vartype filename: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + EvaluationScheduleTask, InsightScheduleTask + + :ivar type: Type of the task. Required. Known values are: "Evaluation" and "Insight". + :vartype type: str or ~azure.ai.projects.models.ScheduleTaskType + :ivar configuration: Configuration for the task. + :vartype configuration: dict[str, str] """ - type: Literal[DataGenerationJobOutputType.FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Azure OpenAI file output. Required. The generated data is an Azure OpenAI File.""" - id: str = rest_field(visibility=["read"]) - """The id of the output Azure OpenAI file. Required.""" - filename: str = rest_field(visibility=["read"]) - """The filename of the output Azure OpenAI file. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Type of the task. Required. Known values are: \"Evaluation\" and \"Insight\".""" + configuration: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Configuration for the task.""" @overload def __init__( self, + *, + type: str, + configuration: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -7245,34 +7166,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobOutputType.FILE # type: ignore -class FileDataGenerationJobSource(DataGenerationJobSource, discriminator="file"): - """File source for data generation jobs — Azure OpenAI file input. +class EvaluationScheduleTask(ScheduleTask, discriminator="Evaluation"): + """Evaluation task for the schedule. - :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 job, which is File. Required. File source — Azure OpenAI - file. - :vartype type: str or ~azure.ai.projects.models.FILE - :ivar id: Input Azure Open AI file id used for data generation. Required. - :vartype id: str + :ivar configuration: Configuration for the task. + :vartype configuration: dict[str, str] + :ivar type: Required. Evaluation task. + :vartype type: str or ~azure.ai.projects.models.EVALUATION + :ivar eval_id: Identifier of the evaluation group. Required. + :vartype eval_id: str + :ivar eval_run: The evaluation run payload. Required. + :vartype eval_run: dict[str, any] """ - type: Literal[DataGenerationJobSourceType.FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The source type for this job, which is File. Required. File source — Azure OpenAI file.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Input Azure Open AI file id used for data generation. Required.""" + type: Literal[ScheduleTaskType.EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Evaluation task.""" + eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) + """Identifier of the evaluation group. Required.""" + eval_run: dict[str, Any] = rest_field(name="evalRun", visibility=["read", "create", "update", "delete", "query"]) + """The evaluation run payload. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - description: Optional[str] = None, + eval_id: str, + eval_run: dict[str, Any], + configuration: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -7284,22 +7206,12 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobSourceType.FILE # type: ignore + self.type = ScheduleTaskType.EVALUATION # type: ignore -class FileDatasetVersion(DatasetVersion, discriminator="uri_file"): - """FileDatasetVersion Definition. +class EvaluationTaxonomy(_Model): + """Evaluation Taxonomy Definition. - :ivar data_uri: URI of the data (`example `_). - Required. - :vartype data_uri: str - :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset - manages storage itself. If true, the underlying data will not be deleted when the dataset - version is deleted. - :vartype is_reference: bool - :ivar connection_name: The Azure Storage Account connection name. Required if - startPendingUploadVersion was not called before creating the Dataset. - :vartype connection_name: str :ivar id: Asset ID, a unique identifier for the asset. :vartype id: str :ivar name: The name of the resource. Required. @@ -7310,21 +7222,44 @@ class FileDatasetVersion(DatasetVersion, discriminator="uri_file"): :vartype description: str :ivar tags: Tag dictionary. Tags can be added, removed, and updated. :vartype tags: dict[str, str] - :ivar type: Dataset type. Required. URI file. - :vartype type: str or ~azure.ai.projects.models.URI_FILE + :ivar taxonomy_input: Input configuration for the evaluation taxonomy. Required. + :vartype taxonomy_input: ~azure.ai.projects.models.EvaluationTaxonomyInput + :ivar taxonomy_categories: List of taxonomy categories. + :vartype taxonomy_categories: list[~azure.ai.projects.models.TaxonomyCategory] + :ivar properties: Additional properties for the evaluation taxonomy. + :vartype properties: dict[str, str] """ - type: Literal[DatasetType.URI_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Dataset type. Required. URI file.""" + 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=["create", "update"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) + """Tag dictionary. Tags can be added, removed, and updated.""" + taxonomy_input: "_models.EvaluationTaxonomyInput" = rest_field( + name="taxonomyInput", visibility=["read", "create", "update", "delete", "query"] + ) + """Input configuration for the evaluation taxonomy. Required.""" + taxonomy_categories: Optional[list["_models.TaxonomyCategory"]] = rest_field( + name="taxonomyCategories", visibility=["read", "create", "update", "delete", "query"] + ) + """List of taxonomy categories.""" + properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional properties for the evaluation taxonomy.""" @overload def __init__( self, *, - data_uri: str, - connection_name: Optional[str] = None, + taxonomy_input: "_models.EvaluationTaxonomyInput", description: Optional[str] = None, tags: Optional[dict[str, str]] = None, + taxonomy_categories: Optional[list["_models.TaxonomyCategory"]] = None, + properties: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -7336,66 +7271,25 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DatasetType.URI_FILE # type: ignore -class FileSearchTool(Tool, discriminator="file_search"): - """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] - """ +class EvaluatorCredentialRequest(_Model): + """Request body for getting evaluator credentials. - 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["_types.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.""" + :ivar blob_uri: The blob URI for the evaluator storage. Example: + ``https://account.blob.core.windows.net:443/container``. Required. + :vartype blob_uri: str + """ + + blob_uri: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The blob URI for the evaluator storage. Example: + ``https://account.blob.core.windows.net:443/container``. Required.""" @overload def __init__( self, *, - vector_store_ids: list[str], - max_num_results: Optional[int] = None, - ranking_options: Optional["_models.RankingOptions"] = None, - filters: Optional["_types.Filters"] = None, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + blob_uri: str, ) -> None: ... @overload @@ -7407,58 +7301,44 @@ 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 FileSearchToolboxTool(ToolboxTool, discriminator="file_search"): - """A file search tool stored in a toolbox. +class EvaluatorGenerationArtifacts(_Model): + """Service-managed provenance artifacts produced by an evaluator generation job. Present only on + EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry + Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace. - :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. FILE_SEARCH. - :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH - :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 vector_store_ids: The IDs of the vector stores to search. - :vartype vector_store_ids: list[str] + :ivar dataset: Reference to the single Foundry Dataset (one combined JSONL file, + version-aligned to ``EvaluatorVersion.version``) holding all artifacts produced by the + generation pipeline. Each row in the JSONL carries a ``kind`` field discriminating its content + (e.g. ``spec``, ``tools``, ``context``). Required. + :vartype dataset: ~azure.ai.projects.models.DatasetReference + :ivar kinds: The kinds of rows present in ``dataset``. Always contains ``"spec"`` (the + generated evaluation specification, a Markdown document describing what the evaluator + measures). May additionally contain ``"tools"`` (when the generation pipeline produced or + inferred OpenAI tool schemas) and/or ``"context"`` (when supplementary materials such as file + uploads or trace samples were used during generation). Required. + :vartype kinds: list[str] """ - type: Literal[ToolboxToolType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FILE_SEARCH.""" - 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["_types.Filters"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Is either a ComparisonFilter type or a CompoundFilter type.""" - vector_store_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The IDs of the vector stores to search.""" + dataset: "_models.DatasetReference" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to + ``EvaluatorVersion.version``) holding all artifacts produced by the generation pipeline. Each + row in the JSONL carries a ``kind`` field discriminating its content (e.g. ``spec``, ``tools``, + ``context``). Required.""" + kinds: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The kinds of rows present in ``dataset``. Always contains ``\"spec\"`` (the generated + evaluation specification, a Markdown document describing what the evaluator measures). May + additionally contain ``\"tools\"`` (when the generation pipeline produced or inferred OpenAI + tool schemas) and/or ``\"context\"`` (when supplementary materials such as file uploads or + trace samples were used during generation). Required.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - max_num_results: Optional[int] = None, - ranking_options: Optional["_models.RankingOptions"] = None, - filters: Optional["_types.Filters"] = None, - vector_store_ids: Optional[list[str]] = None, + dataset: "_models.DatasetReference", + kinds: list[str], ) -> None: ... @overload @@ -7470,33 +7350,78 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.FILE_SEARCH # type: ignore - -class VersionSelectionRule(_Model): - """VersionSelectionRule. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - FixedRatioVersionSelectionRule +class EvaluatorGenerationInputs(_Model): + """Caller-supplied inputs for an evaluator generation job. - :ivar type: Required. "FixedRatio" - :vartype type: str or ~azure.ai.projects.models.VersionSelectorType - :ivar agent_version: The agent version to route traffic to. Required. - :vartype agent_version: str + :ivar sources: Source materials for generation — agent descriptions, prompts, traces, or + datasets. Each entry is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. + Required. + :vartype sources: list[~azure.ai.projects.models.EvaluatorGenerationJobSource] + :ivar model: The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must + provide their own model rather than relying on service-owned capacity. Required. + :vartype model: str + :ivar evaluator_name: The evaluator name (immutable identifier). 1-256 characters; allowed + characters are ASCII letters, digits, underscore (``_``), period (``.``), tilde (``~``), and + hyphen (``-``). The prefix ``builtin.`` is reserved for system-managed evaluators and is + rejected by the service. If an evaluator with this name already exists in the project (and is + rubric-subtype), the service creates a new version under the same name and uses the prior + version's ``dimensions`` as context for incremental improvement (foundation of the post-//build + adaptive loop). Old versions remain queryable via ``get_version(name, version)``. If the + existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the + request is rejected with ``400 Bad Request``. Required. + :vartype evaluator_name: str + :ivar evaluator_display_name: Optional human-friendly display name for the resulting evaluator. + Surfaced as ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the + service uses ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates + this from the immutable ``evaluator_name`` identifier. + :vartype evaluator_display_name: str + :ivar evaluator_description: Optional human-friendly description for the resulting evaluator. + Surfaced as ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected + from the UI alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this + from any other description fields on related models. + :vartype evaluator_description: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. \"FixedRatio\"""" - agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent version to route traffic to. Required.""" + sources: list["_models.EvaluatorGenerationJobSource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry + is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. Required.""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide + their own model rather than relying on service-owned capacity. Required.""" + evaluator_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII + letters, digits, underscore (``_``), period (``.``), tilde (``~``), and hyphen (``-``). The + prefix ``builtin.`` is reserved for system-managed evaluators and is rejected by the service. + If an evaluator with this name already exists in the project (and is rubric-subtype), the + service creates a new version under the same name and uses the prior version's ``dimensions`` + as context for incremental improvement (foundation of the post-//build adaptive loop). Old + versions remain queryable via ``get_version(name, version)``. If the existing evaluator is not + a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with + ``400 Bad Request``. Required.""" + evaluator_display_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional human-friendly display name for the resulting evaluator. Surfaced as + ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the service uses + ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates this from the + immutable ``evaluator_name`` identifier.""" + evaluator_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional human-friendly description for the resulting evaluator. Surfaced as + ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected from the UI + alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this from any + other description fields on related models.""" @overload def __init__( self, *, - type: str, - agent_version: str, + sources: list["_models.EvaluatorGenerationJobSource"], + model: str, + evaluator_name: str, + evaluator_display_name: Optional[str] = None, + evaluator_description: Optional[str] = None, ) -> None: ... @overload @@ -7510,29 +7435,70 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FixedRatioVersionSelectionRule(VersionSelectionRule, discriminator="FixedRatio"): - """FixedRatioVersionSelectionRule. +class EvaluatorGenerationJob(_Model): + """Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator + definitions from source materials. On success, the result is the persisted EvaluatorVersion. - :ivar agent_version: The agent version to route traffic to. Required. - :vartype agent_version: str - :ivar type: Required. FIXED_RATIO. - :vartype type: str or ~azure.ai.projects.models.FIXED_RATIO - :ivar traffic_percentage: The percentage of traffic to route to the version. Must be between 0 - and 100. Required. - :vartype traffic_percentage: int + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: ~azure.ai.projects.models.EvaluatorGenerationInputs + :ivar result: Result produced on success. + :vartype result: ~azure.ai.projects.models.EvaluatorVersion + :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 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 finished, represented in Unix time (seconds since + January 1, 1970). + :vartype finished_at: ~datetime.datetime + :ivar usage: Token consumption summary. Populated when the job reaches a terminal state. + :vartype usage: ~azure.ai.projects.models.EvaluatorGenerationTokenUsage + :ivar input_quality_warnings: Non-fatal input-quality advisories produced by the generation + pipeline. Read-only; service-generated; populated only on terminal jobs when advisories fired. + Omitted when generation was clean. Cleared when a subsequent ``PATCH`` to the paired + ``EvaluatorVersion.definition`` invalidates the advisories. + :vartype input_quality_warnings: + list[~azure.ai.projects.models.RubricGenerationInputQualityWarning] """ - type: Literal[VersionSelectorType.FIXED_RATIO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FIXED_RATIO.""" - traffic_percentage: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The percentage of traffic to route to the version. Must be between 0 and 100. Required.""" + id: str = rest_field(visibility=["read"]) + """Server-assigned unique identifier. Required.""" + inputs: Optional["_models.EvaluatorGenerationInputs"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Caller-supplied inputs.""" + result: Optional["_models.EvaluatorVersion"] = rest_field(visibility=["read"]) + """Result produced on success.""" + status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) + """Error details — populated only on failure.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was created, represented in Unix time (seconds since January 1, + 1970). Required.""" + finished_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).""" + usage: Optional["_models.EvaluatorGenerationTokenUsage"] = rest_field(visibility=["read"]) + """Token consumption summary. Populated when the job reaches a terminal state.""" + input_quality_warnings: Optional[list["_models.RubricGenerationInputQualityWarning"]] = rest_field( + visibility=["read"] + ) + """Non-fatal input-quality advisories produced by the generation pipeline. Read-only; + service-generated; populated only on terminal jobs when advisories fired. Omitted when + generation was clean. Cleared when a subsequent ``PATCH`` to the paired + ``EvaluatorVersion.definition`` invalidates the advisories.""" @overload def __init__( self, *, - agent_version: str, - traffic_percentage: int, + inputs: Optional["_models.EvaluatorGenerationInputs"] = None, ) -> None: ... @overload @@ -7544,47 +7510,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VersionSelectorType.FIXED_RATIO # type: ignore -class FolderDatasetVersion(DatasetVersion, discriminator="uri_folder"): - """FileDatasetVersion Definition. +class EvaluatorGenerationTokenUsage(_Model): + """Token consumption summary for an evaluator generation job. Populated when the job reaches a + terminal state. - :ivar data_uri: URI of the data (`example `_). - Required. - :vartype data_uri: str - :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset - manages storage itself. If true, the underlying data will not be deleted when the dataset - version is deleted. - :vartype is_reference: bool - :ivar connection_name: The Azure Storage Account connection name. Required if - startPendingUploadVersion was not called before creating the Dataset. - :vartype connection_name: str - :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: Dataset type. Required. URI folder. - :vartype type: str or ~azure.ai.projects.models.URI_FOLDER + :ivar input_tokens: Number of input (prompt) tokens consumed. Required. + :vartype input_tokens: int + :ivar output_tokens: Number of output (completion) tokens generated. Required. + :vartype output_tokens: int + :ivar total_tokens: Total tokens consumed (input + output). Required. + :vartype total_tokens: int """ - type: Literal[DatasetType.URI_FOLDER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Dataset type. Required. URI folder.""" + input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of input (prompt) tokens consumed. Required.""" + output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of output (completion) tokens generated. Required.""" + total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Total tokens consumed (input + output). Required.""" @overload def __init__( self, *, - data_uri: str, - connection_name: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + input_tokens: int, + output_tokens: int, + total_tokens: int, ) -> None: ... @overload @@ -7596,32 +7549,54 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DatasetType.URI_FOLDER # type: ignore -class FoundryModelWarning(_Model): - """A warning associated with a model. +class EvaluatorMetric(_Model): + """Evaluator Metric. - :ivar code: The warning code. Known values are: "RuntimeDependentArtifact" and - "UnclassifiedArtifact". - :vartype code: str or ~azure.ai.projects.models.FoundryModelWarningCode - :ivar message: The warning message. - :vartype message: str + :ivar type: Type of the metric. Known values are: "ordinal", "continuous", and "boolean". + :vartype type: str or ~azure.ai.projects.models.EvaluatorMetricType + :ivar desirable_direction: It indicates whether a higher value is better or a lower value is + better for this metric. Known values are: "increase", "decrease", and "neutral". + :vartype desirable_direction: str or ~azure.ai.projects.models.EvaluatorMetricDirection + :ivar min_value: Minimum value for the metric. + :vartype min_value: float + :ivar max_value: Maximum value for the metric. If not specified, it is assumed to be unbounded. + :vartype max_value: float + :ivar threshold: Default pass/fail threshold for this metric. + :vartype threshold: float + :ivar is_primary: Indicates if this metric is primary when there are multiple metrics. + :vartype is_primary: bool """ - code: Optional[Union[str, "_models.FoundryModelWarningCode"]] = rest_field( + type: Optional[Union[str, "_models.EvaluatorMetricType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The warning code. Known values are: \"RuntimeDependentArtifact\" and \"UnclassifiedArtifact\".""" - message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The warning message.""" + """Type of the metric. Known values are: \"ordinal\", \"continuous\", and \"boolean\".""" + desirable_direction: Optional[Union[str, "_models.EvaluatorMetricDirection"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """It indicates whether a higher value is better or a lower value is better for this metric. Known + values are: \"increase\", \"decrease\", and \"neutral\".""" + min_value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Minimum value for the metric.""" + max_value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum value for the metric. If not specified, it is assumed to be unbounded.""" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default pass/fail threshold for this metric.""" + is_primary: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates if this metric is primary when there are multiple metrics.""" @overload def __init__( self, *, - code: Optional[Union[str, "_models.FoundryModelWarningCode"]] = None, - message: Optional[str] = None, + type: Optional[Union[str, "_models.EvaluatorMetricType"]] = None, + desirable_direction: Optional[Union[str, "_models.EvaluatorMetricDirection"]] = None, + min_value: Optional[float] = None, + max_value: Optional[float] = None, + threshold: Optional[float] = None, + is_primary: Optional[bool] = None, ) -> None: ... @overload @@ -7635,45 +7610,122 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FunctionShellToolParam(Tool, discriminator="shell"): - """Shell tool. +class EvaluatorVersion(_Model): + """Evaluator Definition. - :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 name: Deprecated. This property is deprecated and will be removed in a future version. + :ivar display_name: Display Name for evaluator. It helps to find the evaluator easily in AI + Foundry. It does not need to be unique. + :vartype display_name: str + :ivar metadata: Metadata about the evaluator. + :vartype metadata: dict[str, str] + :ivar evaluator_type: The type of the evaluator. Required. Known values are: "builtin" and + "custom". + :vartype evaluator_type: str or ~azure.ai.projects.models.EvaluatorType + :ivar categories: The categories of the evaluator. Required. + :vartype categories: list[str or ~azure.ai.projects.models.EvaluatorCategory] + :ivar supported_evaluation_levels: Evaluation levels this evaluator supports (e.g., ``turn``, + ``conversation``). When omitted on create, the service defaults to ``["turn"]``. On update, + omitting this field leaves it unchanged; an empty list is rejected. Custom code-based + evaluators support only ``turn``; custom prompt-based evaluators support exactly one level + (``turn`` or ``conversation``). + :vartype supported_evaluation_levels: list[str or ~azure.ai.projects.models.EvaluationLevel] + :ivar definition: Definition of the evaluator. Required. + :vartype definition: ~azure.ai.projects.models.EvaluatorDefinition + :ivar generation_artifacts: Provenance artifacts from the generation pipeline. Read-only; + present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact + resolves to a versioned Foundry Dataset. + :vartype generation_artifacts: ~azure.ai.projects.models.EvaluatorGenerationArtifacts + :ivar generation_job_id: Read-only provenance link back to the EvaluatorGenerationJob that + produced this version. Present only on evaluator versions created via the generation pipeline; + absent for manually-created versions and unaffected by subsequent ``PATCH`` calls. + :vartype generation_job_id: str + :ivar warnings: Categories of warnings surfaced on this generated evaluator version. Present + only on versions created via an EvaluatorGenerationJob when the paired job produced non-empty + warnings. Absent (treat as no warnings) when the version is not from generation, when the + paired job was clean, or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's + advisories. Follow ``generation_job_id`` to fetch the detailed warning payloads. + :vartype warnings: list[str or ~azure.ai.projects.models.GenerationWarningType] + :ivar created_by: Creator of the evaluator. Required. + :vartype created_by: str + :ivar created_at: Creation date/time of the evaluator. Required. + :vartype created_at: ~datetime.datetime + :ivar modified_at: Last modified date/time of the evaluator. Required. + :vartype modified_at: ~datetime.datetime + :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: Deprecated. This property is deprecated and will be removed in a future - version. + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. :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 tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] """ - 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( + display_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not + need to be unique.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Metadata about the evaluator.""" + evaluator_type: Union[str, "_models.EvaluatorType"] = rest_field(visibility=["read", "create"]) + """The type of the evaluator. Required. Known values are: \"builtin\" and \"custom\".""" + categories: list[Union[str, "_models.EvaluatorCategory"]] = 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( + """The categories of the evaluator. Required.""" + supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Deprecated. This property is deprecated and will be removed in a future version.""" + """Evaluation levels this evaluator supports (e.g., ``turn``, ``conversation``). When omitted on + create, the service defaults to ``[\"turn\"]``. On update, omitting this field leaves it + unchanged; an empty list is rejected. Custom code-based evaluators support only ``turn``; + custom prompt-based evaluators support exactly one level (``turn`` or ``conversation``).""" + definition: "_models.EvaluatorDefinition" = rest_field(visibility=["read", "create"]) + """Definition of the evaluator. Required.""" + generation_artifacts: Optional["_models.EvaluatorGenerationArtifacts"] = rest_field(visibility=["read"]) + """Provenance artifacts from the generation pipeline. Read-only; present only on evaluator + versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry + Dataset.""" + generation_job_id: Optional[str] = rest_field(visibility=["read"]) + """Read-only provenance link back to the EvaluatorGenerationJob that produced this version. + Present only on evaluator versions created via the generation pipeline; absent for + manually-created versions and unaffected by subsequent ``PATCH`` calls.""" + warnings: Optional[list[Union[str, "_models.GenerationWarningType"]]] = rest_field(visibility=["read"]) + """Categories of warnings surfaced on this generated evaluator version. Present only on versions + created via an EvaluatorGenerationJob when the paired job produced non-empty warnings. Absent + (treat as no warnings) when the version is not from generation, when the paired job was clean, + or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's advisories. Follow + ``generation_job_id`` to fetch the detailed warning payloads.""" + created_by: str = rest_field(visibility=["read"]) + """Creator of the evaluator. Required.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="rfc3339") + """Creation date/time of the evaluator. Required.""" + modified_at: datetime.datetime = rest_field(visibility=["read"], format="rfc3339") + """Last modified date/time of the evaluator. Required.""" + 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=["create", "update"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) + """Tag dictionary. Tags can be added, removed, and updated.""" @overload def __init__( self, *, - environment: Optional["_models.FunctionShellToolParamEnvironment"] = None, - name: Optional[str] = None, + evaluator_type: Union[str, "_models.EvaluatorType"], + categories: list[Union[str, "_models.EvaluatorCategory"]], + definition: "_models.EvaluatorDefinition", + display_name: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = None, description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -7685,31 +7737,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: 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 - """FunctionShellToolParamEnvironmentContainerReferenceParam. +class ExternalAgentDefinition(AgentDefinition, discriminator="external"): + """The external agent definition. Represents a third-party agent hosted outside Foundry (for + example, on GCP or AWS). Registration is metadata-only: Foundry records the agent definition to + light up observability experiences (traces, evaluations) over customer-emitted OpenTelemetry + data. - :ivar type: References a container created with the /v1/containers endpoint. Required. - CONTAINER_REFERENCE. - :vartype type: str or ~azure.ai.projects.models.CONTAINER_REFERENCE - :ivar container_id: The ID of the referenced container. Required. - :vartype container_id: 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. EXTERNAL. + :vartype kind: str or ~azure.ai.projects.models.EXTERNAL + :ivar otel_agent_id: The OpenTelemetry agent identifier used to attribute customer-emitted + spans to this Foundry agent. Spans must include the attribute ``gen_ai.agent.id = + `` to appear under this registration. Defaults to the top-level agent name when + omitted. Provide an explicit value only for migration scenarios where the running external + agent already emits a stable id that differs from the Foundry agent name. The resolved value is + always echoed on read. + :vartype otel_agent_id: str """ - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """References a container created with the /v1/containers endpoint. Required. CONTAINER_REFERENCE.""" - container_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the referenced container. Required.""" - - @overload + kind: Literal[AgentKind.EXTERNAL] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. EXTERNAL.""" + otel_agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry + agent. Spans must include the attribute ``gen_ai.agent.id = `` to appear under + this registration. Defaults to the top-level agent name when omitted. Provide an explicit value + only for migration scenarios where the running external agent already emits a stable id that + differs from the Foundry agent name. The resolved value is always echoed on read.""" + + @overload def __init__( self, *, - container_id: str, + rai_config: Optional["_models.RaiConfig"] = None, + otel_agent_id: Optional[str] = None, ) -> None: ... @overload @@ -7721,32 +7784,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE # type: ignore + self.kind = AgentKind.EXTERNAL # type: ignore -class FunctionShellToolParamEnvironmentLocalEnvironmentParam( - FunctionShellToolParamEnvironment, discriminator="local" -): # pylint: disable=name-too-long - """FunctionShellToolParamEnvironmentLocalEnvironmentParam. +class FabricDataAgentToolParameters(_Model): + """The fabric data agent tool parameters. - :ivar type: Use a local computer environment. Required. LOCAL. - :vartype type: str or ~azure.ai.projects.models.LOCAL - :ivar skills: An optional list of skills. - :vartype skills: list[~azure.ai.projects.models.LocalSkillParam] + :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] """ - type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Use a local computer environment. Required. LOCAL.""" - skills: Optional[list["_models.LocalSkillParam"]] = rest_field( + project_connections: Optional[list["_models.ToolProjectConnection"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """An optional list of skills.""" + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" @overload def __init__( self, *, - skills: Optional[list["_models.LocalSkillParam"]] = None, + project_connections: Optional[list["_models.ToolProjectConnection"]] = None, ) -> None: ... @overload @@ -7758,47 +7817,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = FunctionShellToolParamEnvironmentType.LOCAL # type: ignore -class FunctionTool(Tool, discriminator="function"): - """Function. +class FabricIQPreviewTool(Tool, discriminator="fabric_iq_preview"): + """A FabricIQ server-side tool. - :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 description: - :vartype description: str - :ivar parameters: Required. - :vartype parameters: 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 type: The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.FABRIC_IQ_PREVIEW + :ivar project_connection_id: The ID of the FabricIQ project connection. Required. + :vartype project_connection_id: str + :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. + :vartype server_label: str + :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from + the project connection will be used. + :vartype server_url: str + :ivar require_approval: (Optional) Whether the agent requires approval before executing + actions. Default is always. Is either a MCPToolRequireApproval type or a str type. + :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str """ - 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.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - 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.""" + type: Literal[ToolType.FABRIC_IQ_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the FabricIQ project connection. Required.""" + server_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """(Optional) The label of the FabricIQ MCP server to connect to.""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project + connection will be used.""" + require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """(Optional) Whether the agent requires approval before executing actions. Default is always. Is + either a MCPToolRequireApproval type or a str type.""" @overload def __init__( self, *, - name: str, - parameters: dict[str, Any], - strict: bool, - description: Optional[str] = None, - defer_loading: Optional[bool] = None, + project_connection_id: str, + server_label: Optional[str] = None, + server_url: Optional[str] = None, + require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = None, ) -> None: ... @overload @@ -7810,47 +7870,60 @@ 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 + self.type = ToolType.FABRIC_IQ_PREVIEW # type: ignore -class FunctionToolParam(_Model): - """FunctionToolParam. +class FabricIQPreviewToolboxTool(ToolboxTool, discriminator="fabric_iq_preview"): + """A FabricIQ tool stored in a toolbox. - :ivar name: Required. + :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str - :ivar description: + :ivar description: Optional user-defined description for this tool or configuration. :vartype description: str - :ivar parameters: - :vartype parameters: ~azure.ai.projects.models.EmptyModelParam - :ivar strict: - :vartype strict: bool - :ivar type: Required. Default value is "function". - :vartype type: str - :ivar defer_loading: Whether this function should be deferred and discovered via tool search. - :vartype defer_loading: bool + :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. FABRIC_IQ_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.FABRIC_IQ_PREVIEW + :ivar project_connection_id: The ID of the FabricIQ project connection. Required. + :vartype project_connection_id: str + :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. + :vartype server_label: str + :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from + the project connection will be used. + :vartype server_url: str + :ivar require_approval: (Optional) Whether the agent requires approval before executing + actions. Default is always. Is either a MCPToolRequireApproval type or a str type. + :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - parameters: Optional["_models.EmptyModelParam"] = rest_field( + type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FABRIC_IQ_PREVIEW.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the FabricIQ project connection. Required.""" + server_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """(Optional) The label of the FabricIQ MCP server to connect to.""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project + connection will be used.""" + require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"function\".""" - defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this function should be deferred and discovered via tool search.""" + """(Optional) Whether the agent requires approval before executing actions. Default is always. Is + either a MCPToolRequireApproval type or a str type.""" @overload def __init__( self, *, - name: str, + project_connection_id: str, + name: Optional[str] = None, description: Optional[str] = None, - parameters: Optional["_models.EmptyModelParam"] = None, - strict: Optional[bool] = None, - defer_loading: Optional[bool] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + server_label: Optional[str] = None, + server_url: Optional[str] = None, + require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = None, ) -> None: ... @overload @@ -7862,51 +7935,49 @@ 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" + self.type = ToolboxToolType.FABRIC_IQ_PREVIEW # type: ignore -class GitHubIssueRoutineTrigger(RoutineTrigger, discriminator="github_issue"): - """A GitHub issue routine trigger. +class FieldMapping(_Model): + """Field mapping configuration class. - :ivar type: The trigger type. Required. A GitHub issue trigger. - :vartype type: str or ~azure.ai.projects.models.GITHUB_ISSUE - :ivar connection_id: The workspace connection identifier that resolves the GitHub configuration - for the trigger. Required. - :vartype connection_id: str - :ivar owner: The GitHub owner or organization that scopes which issues can fire the trigger. - Required. - :vartype owner: str - :ivar repository: The GitHub repository filter that scopes which issues can fire the trigger. - Required. - :vartype repository: str - :ivar issue_event: The GitHub issue event that fires the routine. Required. Known values are: - "opened" and "closed". - :vartype issue_event: str or ~azure.ai.projects.models.GitHubIssueEvent + :ivar content_fields: List of fields with text content. Required. + :vartype content_fields: list[str] + :ivar filepath_field: Path of file to be used as a source of text content. + :vartype filepath_field: str + :ivar title_field: Field containing the title of the document. + :vartype title_field: str + :ivar url_field: Field containing the url of the document. + :vartype url_field: str + :ivar vector_fields: List of fields with vector content. + :vartype vector_fields: list[str] + :ivar metadata_fields: List of fields with metadata content. + :vartype metadata_fields: list[str] """ - type: Literal[RoutineTriggerType.GITHUB_ISSUE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The trigger type. Required. A GitHub issue trigger.""" - connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The workspace connection identifier that resolves the GitHub configuration for the trigger. - Required.""" - owner: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The GitHub owner or organization that scopes which issues can fire the trigger. Required.""" - repository: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The GitHub repository filter that scopes which issues can fire the trigger. Required.""" - issue_event: Union[str, "_models.GitHubIssueEvent"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The GitHub issue event that fires the routine. Required. Known values are: \"opened\" and - \"closed\".""" + content_fields: list[str] = rest_field(name="contentFields", visibility=["create"]) + """List of fields with text content. Required.""" + filepath_field: Optional[str] = rest_field(name="filepathField", visibility=["create"]) + """Path of file to be used as a source of text content.""" + title_field: Optional[str] = rest_field(name="titleField", visibility=["create"]) + """Field containing the title of the document.""" + url_field: Optional[str] = rest_field(name="urlField", visibility=["create"]) + """Field containing the url of the document.""" + vector_fields: Optional[list[str]] = rest_field(name="vectorFields", visibility=["create"]) + """List of fields with vector content.""" + metadata_fields: Optional[list[str]] = rest_field(name="metadataFields", visibility=["create"]) + """List of fields with metadata content.""" @overload def __init__( self, *, - connection_id: str, - owner: str, - repository: str, - issue_event: Union[str, "_models.GitHubIssueEvent"], + content_fields: list[str], + filepath_field: Optional[str] = None, + title_field: Optional[str] = None, + url_field: Optional[str] = None, + vector_fields: Optional[list[str]] = None, + metadata_fields: Optional[list[str]] = None, ) -> None: ... @overload @@ -7918,28 +7989,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineTriggerType.GITHUB_ISSUE # type: ignore -class TelemetryEndpointAuth(_Model): - """Authentication configuration for a telemetry endpoint. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - HeaderTelemetryEndpointAuth +class FileDataGenerationJobOutput(DataGenerationJobOutput, discriminator="file"): + """Azure OpenAI file output for a data generation job. - :ivar type: The authentication type. Required. "header" - :vartype type: str or ~azure.ai.projects.models.TelemetryEndpointAuthType + :ivar type: Azure OpenAI file output. Required. The generated data is an Azure OpenAI File. + :vartype type: str or ~azure.ai.projects.models.FILE + :ivar id: The id of the output Azure OpenAI file. Required. + :vartype id: str + :ivar filename: The filename of the output Azure OpenAI file. Required. + :vartype filename: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The authentication type. Required. \"header\"""" - - @overload - def __init__( - self, - *, - type: str, + type: Literal[DataGenerationJobOutputType.FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Azure OpenAI file output. Required. The generated data is an Azure OpenAI File.""" + id: str = rest_field(visibility=["read"]) + """The id of the output Azure OpenAI file. Required.""" + filename: str = rest_field(visibility=["read"]) + """The filename of the output Azure OpenAI file. Required.""" + + @overload + def __init__( + self, ) -> None: ... @overload @@ -7951,40 +8023,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = DataGenerationJobOutputType.FILE # type: ignore -class HeaderTelemetryEndpointAuth(TelemetryEndpointAuth, discriminator="header"): - """Header-based secret authentication for a telemetry endpoint. The resolved secret value is - injected as an HTTP header. +class FileDataGenerationJobSource(DataGenerationJobSource, discriminator="file"): + """File source for data generation jobs — Azure OpenAI file input. - :ivar type: The authentication type, always 'header' for header-based secret authentication. - Required. Header-based secret authentication. - :vartype type: str or ~azure.ai.projects.models.HEADER - :ivar header_name: The name of the HTTP header to inject the secret value into. Required. - :vartype header_name: str - :ivar secret_id: The identifier of the secret store or connection. Required. - :vartype secret_id: str - :ivar secret_key: The key within the secret to retrieve the authentication value. Required. - :vartype secret_key: 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 job, which is File. Required. File source — Azure OpenAI + file. + :vartype type: str or ~azure.ai.projects.models.FILE + :ivar id: Input Azure Open AI file id used for data generation. Required. + :vartype id: str """ - type: Literal[TelemetryEndpointAuthType.HEADER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The authentication type, always 'header' for header-based secret authentication. Required. - Header-based secret authentication.""" - header_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the HTTP header to inject the secret value into. Required.""" - secret_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The identifier of the secret store or connection. Required.""" - secret_key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The key within the secret to retrieve the authentication value. Required.""" + type: Literal[DataGenerationJobSourceType.FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The source type for this job, which is File. Required. File source — Azure OpenAI file.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Input Azure Open AI file id used for data generation. Required.""" @overload def __init__( self, *, - header_name: str, - secret_id: str, - secret_key: str, + id: str, # pylint: disable=redefined-builtin + description: Optional[str] = None, ) -> None: ... @overload @@ -7996,79 +8062,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TelemetryEndpointAuthType.HEADER # type: ignore + self.type = DataGenerationJobSourceType.FILE # type: ignore -class HostedAgentDefinition(AgentDefinition, discriminator="hosted"): - """The hosted agent definition. +class FileDatasetVersion(DatasetVersion, discriminator="uri_file"): + """FileDatasetVersion Definition. - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig - :ivar kind: Required. HOSTED. - :vartype kind: str or ~azure.ai.projects.models.HOSTED - :ivar cpu: The CPU configuration for the hosted agent. Required. - :vartype cpu: str - :ivar memory: The memory configuration for the hosted agent. Required. - :vartype memory: str - :ivar environment_variables: Environment variables to set in the hosted agent container. - :vartype environment_variables: dict[str, str] - :ivar container_configuration: Container-based deployment configuration. Provide this for - image-based deployments. Mutually exclusive with code_configuration — the service validates - that exactly one is set. - :vartype container_configuration: ~azure.ai.projects.models.ContainerConfiguration - :ivar protocol_versions: The protocols that the agent supports for ingress communication. - :vartype protocol_versions: list[~azure.ai.projects.models.ProtocolVersionRecord] - :ivar code_configuration: Code-based deployment configuration. Provide this for code-based - deployments. Mutually exclusive with container_configuration — the service validates that - exactly one is set. - :vartype code_configuration: ~azure.ai.projects.models.CodeConfiguration - :ivar telemetry_config: Optional customer-supplied telemetry configuration for exporting - container logs, traces, and metrics. - :vartype telemetry_config: ~azure.ai.projects.models.TelemetryConfig + :ivar data_uri: URI of the data (`example `_). + Required. + :vartype data_uri: str + :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset + manages storage itself. If true, the underlying data will not be deleted when the dataset + version is deleted. + :vartype is_reference: bool + :ivar connection_name: The Azure Storage Account connection name. Required if + startPendingUploadVersion was not called before creating the Dataset. + :vartype connection_name: str + :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: Dataset type. Required. URI file. + :vartype type: str or ~azure.ai.projects.models.URI_FILE """ - kind: Literal[AgentKind.HOSTED] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. HOSTED.""" - cpu: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The CPU configuration for the hosted agent. Required.""" - memory: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The memory configuration for the hosted agent. Required.""" - environment_variables: Optional[dict[str, str]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Environment variables to set in the hosted agent container.""" - container_configuration: Optional["_models.ContainerConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Container-based deployment configuration. Provide this for image-based deployments. Mutually - exclusive with code_configuration — the service validates that exactly one is set.""" - protocol_versions: Optional[list["_models.ProtocolVersionRecord"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The protocols that the agent supports for ingress communication.""" - code_configuration: Optional["_models.CodeConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Code-based deployment configuration. Provide this for code-based deployments. Mutually - exclusive with container_configuration — the service validates that exactly one is set.""" - telemetry_config: Optional["_models.TelemetryConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional customer-supplied telemetry configuration for exporting container logs, traces, and - metrics.""" + type: Literal[DatasetType.URI_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset type. Required. URI file.""" @overload def __init__( self, *, - cpu: str, - memory: str, - rai_config: Optional["_models.RaiConfig"] = None, - environment_variables: Optional[dict[str, str]] = None, - container_configuration: Optional["_models.ContainerConfiguration"] = None, - protocol_versions: Optional[list["_models.ProtocolVersionRecord"]] = None, - code_configuration: Optional["_models.CodeConfiguration"] = None, - telemetry_config: Optional["_models.TelemetryConfig"] = None, + data_uri: str, + connection_name: Optional[str] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -8080,22 +8114,66 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = AgentKind.HOSTED # type: ignore + self.type = DatasetType.URI_FILE # type: ignore -class HourlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Hourly"): - """Hourly recurrence schedule. +class FileSearchTool(Tool, discriminator="file_search"): + """File search. - :ivar type: Required. Hourly recurrence pattern. - :vartype type: str or ~azure.ai.projects.models.HOURLY + :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[RecurrenceType.HOURLY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Hourly recurrence pattern.""" + 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["_types.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["_types.Filters"] = None, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -8107,31 +8185,61 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RecurrenceType.HOURLY # type: ignore + self.type = ToolType.FILE_SEARCH # type: ignore -class HumanEvaluationPreviewRuleAction(EvaluationRuleAction, discriminator="humanEvaluationPreview"): - """Evaluation rule action for human evaluation. +class FileSearchToolboxTool(ToolboxTool, discriminator="file_search"): + """A file search tool stored in a toolbox. - :ivar type: Required. Human evaluation preview. - :vartype type: str or ~azure.ai.projects.models.HUMAN_EVALUATION_PREVIEW - :ivar template_id: Human evaluation template Id. Required. - :vartype template_id: str + :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. FILE_SEARCH. + :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH + :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 vector_store_ids: The IDs of the vector stores to search. + :vartype vector_store_ids: list[str] """ - type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Human evaluation preview.""" - template_id: str = rest_field(name="templateId", visibility=["read", "create", "update", "delete", "query"]) - """Human evaluation template Id. Required.""" + type: Literal[ToolboxToolType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FILE_SEARCH.""" + 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["_types.Filters"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is either a ComparisonFilter type or a CompoundFilter type.""" + vector_store_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The IDs of the vector stores to search.""" @overload def __init__( self, *, - template_id: str, - ) -> None: ... - - @overload + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + max_num_results: Optional[int] = None, + ranking_options: Optional["_models.RankingOptions"] = None, + filters: Optional["_types.Filters"] = None, + vector_store_ids: Optional[list[str]] = None, + ) -> None: ... + + @overload def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. @@ -8140,29 +8248,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW # type: ignore + self.type = ToolboxToolType.FILE_SEARCH # type: ignore -class HybridSearchOptions(_Model): - """HybridSearchOptions. +class VersionSelectionRule(_Model): + """VersionSelectionRule. - :ivar embedding_weight: The weight of the embedding in the reciprocal ranking fusion. Required. - :vartype embedding_weight: float - :ivar text_weight: The weight of the text in the reciprocal ranking fusion. Required. - :vartype text_weight: float + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + FixedRatioVersionSelectionRule + + :ivar type: Required. "FixedRatio" + :vartype type: str or ~azure.ai.projects.models.VersionSelectorType + :ivar agent_version: The agent version to route traffic to. Required. + :vartype agent_version: str """ - embedding_weight: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The weight of the embedding in the reciprocal ranking fusion. Required.""" - text_weight: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The weight of the text in the reciprocal ranking fusion. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. \"FixedRatio\"""" + agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent version to route traffic to. Required.""" @overload def __init__( self, *, - embedding_weight: float, - text_weight: float, + type: str, + agent_version: str, ) -> None: ... @overload @@ -8176,156 +8288,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ImageGenTool(Tool, discriminator="image_generation"): - """Image generation tool. +class FixedRatioVersionSelectionRule(VersionSelectionRule, discriminator="FixedRatio"): + """FixedRatioVersionSelectionRule. - :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"], str - :vartype model: 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: Background type for the generated image. One of ``transparent``, ``opaque``, - or ``auto``. 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] + :ivar agent_version: The agent version to route traffic to. Required. + :vartype agent_version: str + :ivar type: Required. FIXED_RATIO. + :vartype type: str or ~azure.ai.projects.models.FIXED_RATIO + :ivar traffic_percentage: The percentage of traffic to route to the version. Must be between 0 + and 100. Required. + :vartype traffic_percentage: int """ - 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"], 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\"], 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"] - ) - """Background type for the generated image. One of ``transparent``, ``opaque``, or ``auto``. - 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.""" + type: Literal[VersionSelectorType.FIXED_RATIO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FIXED_RATIO.""" + traffic_percentage: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The percentage of traffic to route to the version. Must be between 0 and 100. Required.""" @overload def __init__( self, *, - model: Optional[ - Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], 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, + agent_version: str, + traffic_percentage: int, ) -> None: ... @overload @@ -8337,27 +8322,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.IMAGE_GENERATION # type: ignore + self.type = VersionSelectorType.FIXED_RATIO # type: ignore -class ImageGenToolInputImageMask(_Model): - """ImageGenToolInputImageMask. +class FolderDatasetVersion(DatasetVersion, discriminator="uri_folder"): + """FileDatasetVersion Definition. - :ivar image_url: - :vartype image_url: str - :ivar file_id: - :vartype file_id: str + :ivar data_uri: URI of the data (`example `_). + Required. + :vartype data_uri: str + :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset + manages storage itself. If true, the underlying data will not be deleted when the dataset + version is deleted. + :vartype is_reference: bool + :ivar connection_name: The Azure Storage Account connection name. Required if + startPendingUploadVersion was not called before creating the Dataset. + :vartype connection_name: str + :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: Dataset type. Required. URI folder. + :vartype type: str or ~azure.ai.projects.models.URI_FOLDER """ - image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[DatasetType.URI_FOLDER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset type. Required. URI folder.""" @overload def __init__( self, *, - image_url: Optional[str] = None, - file_id: Optional[str] = None, + data_uri: str, + connection_name: Optional[str] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -8369,37 +8374,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = DatasetType.URI_FOLDER # type: ignore -class InlineSkillParam(ContainerSkill, discriminator="inline"): - """InlineSkillParam. - - :ivar type: Defines an inline skill for this request. Required. INLINE. - :vartype type: str or ~azure.ai.projects.models.INLINE - :ivar name: The name of the skill. Required. - :vartype name: str - :ivar description: The description of the skill. Required. - :vartype description: str - :ivar source: Inline skill payload. Required. - :vartype source: ~azure.ai.projects.models.InlineSkillSourceParam - """ +class FoundryModelWarning(_Model): + """A warning associated with a model. - type: Literal[ContainerSkillType.INLINE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Defines an inline skill for this request. Required. INLINE.""" - 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.""" - source: "_models.InlineSkillSourceParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Inline skill payload. Required.""" + :ivar code: The warning code. Known values are: "RuntimeDependentArtifact" and + "UnclassifiedArtifact". + :vartype code: str or ~azure.ai.projects.models.FoundryModelWarningCode + :ivar message: The warning message. + :vartype message: str + """ + + code: Optional[Union[str, "_models.FoundryModelWarningCode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The warning code. Known values are: \"RuntimeDependentArtifact\" and \"UnclassifiedArtifact\".""" + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The warning message.""" @overload def __init__( self, *, - name: str, - description: str, - source: "_models.InlineSkillSourceParam", + code: Optional[Union[str, "_models.FoundryModelWarningCode"]] = None, + message: Optional[str] = None, ) -> None: ... @overload @@ -8411,35 +8411,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContainerSkillType.INLINE # type: ignore -class InlineSkillSourceParam(_Model): - """Inline skill payload. +class FunctionShellToolParam(Tool, discriminator="shell"): + """Shell tool. - :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 + :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 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["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.""" + 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"] + ) + 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, *, - data: str, + environment: Optional["_models.FunctionShellToolParamEnvironment"] = None, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -8451,48 +8463,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["base64"] = "base64" - self.media_type: Literal["application/zip"] = "application/zip" + self.type = ToolType.SHELL # type: ignore -class Insight(_Model): - """The response body for cluster insights. +class FunctionShellToolParamEnvironmentContainerReferenceParam( + FunctionShellToolParamEnvironment, discriminator="container_reference" +): # pylint: disable=name-too-long + """FunctionShellToolParamEnvironmentContainerReferenceParam. - :ivar insight_id: The unique identifier for the insights report. Required. - :vartype insight_id: str - :ivar metadata: Metadata about the insights report. Required. - :vartype metadata: ~azure.ai.projects.models.InsightsMetadata - :ivar state: The current state of the insights. Required. Known values are: "NotStarted", - "Running", "Succeeded", "Failed", and "Canceled". - :vartype state: str or ~azure.ai.projects.models.OperationState - :ivar display_name: User friendly display name for the insight. Required. - :vartype display_name: str - :ivar request: Request for the insights analysis. Required. - :vartype request: ~azure.ai.projects.models.InsightRequest - :ivar result: The result of the insights report. - :vartype result: ~azure.ai.projects.models.InsightResult + :ivar type: References a container created with the /v1/containers endpoint. Required. + CONTAINER_REFERENCE. + :vartype type: str or ~azure.ai.projects.models.CONTAINER_REFERENCE + :ivar container_id: The ID of the referenced container. Required. + :vartype container_id: str """ - insight_id: str = rest_field(name="id", visibility=["read"]) - """The unique identifier for the insights report. Required.""" - metadata: "_models.InsightsMetadata" = rest_field(visibility=["read"]) - """Metadata about the insights report. Required.""" - state: Union[str, "_models.OperationState"] = rest_field(visibility=["read"]) - """The current state of the insights. Required. Known values are: \"NotStarted\", \"Running\", - \"Succeeded\", \"Failed\", and \"Canceled\".""" - display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"]) - """User friendly display name for the insight. Required.""" - request: "_models.InsightRequest" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Request for the insights analysis. Required.""" - result: Optional["_models.InsightResult"] = rest_field(visibility=["read"]) - """The result of the insights report.""" + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """References a container created with the /v1/containers endpoint. Required. CONTAINER_REFERENCE.""" + container_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the referenced container. Required.""" @overload def __init__( self, *, - display_name: str, - request: "_models.InsightRequest", + container_id: str, ) -> None: ... @overload @@ -8504,66 +8499,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE # type: ignore -class InsightCluster(_Model): - """A cluster of analysis samples. +class FunctionShellToolParamEnvironmentLocalEnvironmentParam( + FunctionShellToolParamEnvironment, discriminator="local" +): # pylint: disable=name-too-long + """FunctionShellToolParamEnvironmentLocalEnvironmentParam. - :ivar id: The id of the analysis cluster. Required. - :vartype id: str - :ivar label: Label for the cluster. Required. - :vartype label: str - :ivar suggestion: Suggestion for the cluster. Required. - :vartype suggestion: str - :ivar suggestion_title: The title of the suggestion for the cluster. Required. - :vartype suggestion_title: str - :ivar description: Description of the analysis cluster. Required. - :vartype description: str - :ivar weight: The weight of the analysis cluster. This indicate number of samples in the - cluster. Required. - :vartype weight: int - :ivar sub_clusters: List of subclusters within this cluster. Empty if no subclusters exist. - :vartype sub_clusters: list[~azure.ai.projects.models.InsightCluster] - :ivar samples: List of samples that belong to this cluster. Empty if samples are part of - subclusters. - :vartype samples: list[~azure.ai.projects.models.InsightSample] + :ivar type: Use a local computer environment. Required. LOCAL. + :vartype type: str or ~azure.ai.projects.models.LOCAL + :ivar skills: An optional list of skills. + :vartype skills: list[~azure.ai.projects.models.LocalSkillParam] """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The id of the analysis cluster. Required.""" - label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Label for the cluster. Required.""" - suggestion: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Suggestion for the cluster. Required.""" - suggestion_title: str = rest_field( - name="suggestionTitle", visibility=["read", "create", "update", "delete", "query"] - ) - """The title of the suggestion for the cluster. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the analysis cluster. Required.""" - weight: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The weight of the analysis cluster. This indicate number of samples in the cluster. Required.""" - sub_clusters: Optional[list["_models.InsightCluster"]] = rest_field( - name="subClusters", visibility=["read", "create", "update", "delete", "query"] - ) - """List of subclusters within this cluster. Empty if no subclusters exist.""" - samples: Optional[list["_models.InsightSample"]] = rest_field( + type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Use a local computer environment. Required. LOCAL.""" + skills: Optional[list["_models.LocalSkillParam"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """List of samples that belong to this cluster. Empty if samples are part of subclusters.""" + """An optional list of skills.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - label: str, - suggestion: str, - suggestion_title: str, - description: str, - weight: int, - sub_clusters: Optional[list["_models.InsightCluster"]] = None, - samples: Optional[list["_models.InsightSample"]] = None, + skills: Optional[list["_models.LocalSkillParam"]] = None, ) -> None: ... @overload @@ -8575,28 +8536,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = FunctionShellToolParamEnvironmentType.LOCAL # type: ignore -class InsightModelConfiguration(_Model): - """Configuration of the model used in the insight generation. +class FunctionTool(Tool, discriminator="function"): + """Function. - :ivar model_deployment_name: The model deployment to be evaluated. Accepts either the - deployment name alone or with the connection name as '{connectionName}/'. - Required. - :vartype model_deployment_name: 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 description: + :vartype description: str + :ivar parameters: Required. + :vartype parameters: 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 """ - model_deployment_name: str = rest_field( - name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] - ) - """The model deployment to be evaluated. Accepts either the deployment name alone or with the - connection name as '{connectionName}/'. Required.""" + 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.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + 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.""" @overload def __init__( self, *, - model_deployment_name: str, + name: str, + parameters: dict[str, Any], + strict: bool, + description: Optional[str] = None, + defer_loading: Optional[bool] = None, ) -> None: ... @overload @@ -8608,68 +8588,47 @@ 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 InsightScheduleTask(ScheduleTask, discriminator="Insight"): - """Insight task for the schedule. +class FunctionToolParam(_Model): + """FunctionToolParam. - :ivar configuration: Configuration for the task. - :vartype configuration: dict[str, str] - :ivar type: Required. Insight task. - :vartype type: str or ~azure.ai.projects.models.INSIGHT - :ivar insight: The insight payload. Required. - :vartype insight: ~azure.ai.projects.models.Insight + :ivar name: Required. + :vartype name: str + :ivar description: + :vartype description: str + :ivar parameters: + :vartype parameters: ~azure.ai.projects.models.EmptyModelParam + :ivar strict: + :vartype strict: bool + :ivar type: Required. Default value is "function". + :vartype type: str + :ivar defer_loading: Whether this function should be deferred and discovered via tool search. + :vartype defer_loading: bool """ - type: Literal[ScheduleTaskType.INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Insight task.""" - insight: "_models.Insight" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The insight payload. Required.""" - - @overload - def __init__( - self, - *, - insight: "_models.Insight", - configuration: 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) - self.type = ScheduleTaskType.INSIGHT # type: ignore - - -class InsightsMetadata(_Model): - """Metadata about the insights. - - :ivar created_at: The timestamp when the insights were created. Required. - :vartype created_at: ~datetime.datetime - :ivar completed_at: The timestamp when the insights were completed. - :vartype completed_at: ~datetime.datetime - """ - - created_at: datetime.datetime = rest_field( - name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The timestamp when the insights were created. Required.""" - completed_at: Optional[datetime.datetime] = rest_field( - name="completedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: Optional["_models.EmptyModelParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The timestamp when the insights were completed.""" + strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"function\".""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this function should be deferred and discovered via tool search.""" @overload def __init__( self, *, - created_at: datetime.datetime, - completed_at: Optional[datetime.datetime] = None, + name: str, + description: Optional[str] = None, + parameters: Optional["_models.EmptyModelParam"] = None, + strict: Optional[bool] = None, + defer_loading: Optional[bool] = None, ) -> None: ... @overload @@ -8681,47 +8640,51 @@ 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 InsightSummary(_Model): - """Summary of the error cluster analysis. +class GitHubIssueRoutineTrigger(RoutineTrigger, discriminator="github_issue"): + """A GitHub issue routine trigger. - :ivar sample_count: Total number of samples analyzed. Required. - :vartype sample_count: int - :ivar unique_subcluster_count: Total number of unique subcluster labels. Required. - :vartype unique_subcluster_count: int - :ivar unique_cluster_count: Total number of unique clusters. Required. - :vartype unique_cluster_count: int - :ivar method: Method used for clustering. Required. - :vartype method: str - :ivar usage: Token usage while performing clustering analysis. Required. - :vartype usage: ~azure.ai.projects.models.ClusterTokenUsage + :ivar type: The trigger type. Required. A GitHub issue trigger. + :vartype type: str or ~azure.ai.projects.models.GITHUB_ISSUE + :ivar connection_id: The workspace connection identifier that resolves the GitHub configuration + for the trigger. Required. + :vartype connection_id: str + :ivar owner: The GitHub owner or organization that scopes which issues can fire the trigger. + Required. + :vartype owner: str + :ivar repository: The GitHub repository filter that scopes which issues can fire the trigger. + Required. + :vartype repository: str + :ivar issue_event: The GitHub issue event that fires the routine. Required. Known values are: + "opened" and "closed". + :vartype issue_event: str or ~azure.ai.projects.models.GitHubIssueEvent """ - sample_count: int = rest_field(name="sampleCount", visibility=["read", "create", "update", "delete", "query"]) - """Total number of samples analyzed. Required.""" - unique_subcluster_count: int = rest_field( - name="uniqueSubclusterCount", visibility=["read", "create", "update", "delete", "query"] - ) - """Total number of unique subcluster labels. Required.""" - unique_cluster_count: int = rest_field( - name="uniqueClusterCount", visibility=["read", "create", "update", "delete", "query"] + type: Literal[RoutineTriggerType.GITHUB_ISSUE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The trigger type. Required. A GitHub issue trigger.""" + connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The workspace connection identifier that resolves the GitHub configuration for the trigger. + Required.""" + owner: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The GitHub owner or organization that scopes which issues can fire the trigger. Required.""" + repository: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The GitHub repository filter that scopes which issues can fire the trigger. Required.""" + issue_event: Union[str, "_models.GitHubIssueEvent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Total number of unique clusters. Required.""" - method: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Method used for clustering. Required.""" - usage: "_models.ClusterTokenUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Token usage while performing clustering analysis. Required.""" + """The GitHub issue event that fires the routine. Required. Known values are: \"opened\" and + \"closed\".""" @overload def __init__( self, *, - sample_count: int, - unique_subcluster_count: int, - unique_cluster_count: int, - method: str, - usage: "_models.ClusterTokenUsage", + connection_id: str, + owner: str, + repository: str, + issue_event: Union[str, "_models.GitHubIssueEvent"], ) -> None: ... @overload @@ -8733,31 +8696,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RoutineTriggerType.GITHUB_ISSUE # type: ignore -class InvocationsProtocolConfiguration(_Model): - """Configuration specific to the invocations protocol.""" - - -class InvocationsWsProtocolConfiguration(_Model): - """Configuration specific to the WebSocket-based invocations protocol.""" - - -class RoutineDispatchPayload(_Model): - """Base model for a manual dispatch payload. +class TelemetryEndpointAuth(_Model): + """Authentication configuration for a telemetry endpoint. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - InvokeAgentInvocationsApiDispatchPayload, InvokeAgentResponsesApiDispatchPayload + HeaderTelemetryEndpointAuth - :ivar type: The manual dispatch payload type. Required. Known values are: - "invoke_agent_responses_api" and "invoke_agent_invocations_api". - :vartype type: str or ~azure.ai.projects.models.RoutineDispatchPayloadType + :ivar type: The authentication type. Required. "header" + :vartype type: str or ~azure.ai.projects.models.TelemetryEndpointAuthType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The manual dispatch payload type. Required. Known values are: \"invoke_agent_responses_api\" - and \"invoke_agent_invocations_api\".""" + """The authentication type. Required. \"header\"""" @overload def __init__( @@ -8777,29 +8731,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InvokeAgentInvocationsApiDispatchPayload(RoutineDispatchPayload, discriminator="invoke_agent_invocations_api"): - """A manual payload used to test an invocations API routine dispatch. +class HeaderTelemetryEndpointAuth(TelemetryEndpointAuth, discriminator="header"): + """Header-based secret authentication for a telemetry endpoint. The resolved secret value is + injected as an HTTP header. - :ivar type: The manual dispatch payload type. Required. A manual payload for an invocations API - routine dispatch. - :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_INVOCATIONS_API - :ivar input: The JSON value sent as the complete downstream invocations input. The value is - passed through as-is and can be an object, string, number, boolean, array, or null. Required. - :vartype input: any + :ivar type: The authentication type, always 'header' for header-based secret authentication. + Required. Header-based secret authentication. + :vartype type: str or ~azure.ai.projects.models.HEADER + :ivar header_name: The name of the HTTP header to inject the secret value into. Required. + :vartype header_name: str + :ivar secret_id: The identifier of the secret store or connection. Required. + :vartype secret_id: str + :ivar secret_key: The key within the secret to retrieve the authentication value. Required. + :vartype secret_key: str """ - type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The manual dispatch payload type. Required. A manual payload for an invocations API routine - dispatch.""" - input: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON value sent as the complete downstream invocations input. The value is passed through - as-is and can be an object, string, number, boolean, array, or null. Required.""" + type: Literal[TelemetryEndpointAuthType.HEADER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The authentication type, always 'header' for header-based secret authentication. Required. + Header-based secret authentication.""" + header_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the HTTP header to inject the secret value into. Required.""" + secret_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the secret store or connection. Required.""" + secret_key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The key within the secret to retrieve the authentication value. Required.""" @overload def __init__( self, *, - input: Any, + header_name: str, + secret_id: str, + secret_key: str, ) -> None: ... @overload @@ -8811,30 +8774,79 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API # type: ignore - + self.type = TelemetryEndpointAuthType.HEADER # type: ignore -class RoutineAction(_Model): - """Base model for a routine action. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - InvokeAgentInvocationsApiRoutineAction, InvokeAgentResponsesApiRoutineAction +class HostedAgentDefinition(AgentDefinition, discriminator="hosted"): + """The hosted agent definition. - :ivar type: The action type. Required. Known values are: "invoke_agent_responses_api" and - "invoke_agent_invocations_api". - :vartype type: str or ~azure.ai.projects.models.RoutineActionType + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar kind: Required. HOSTED. + :vartype kind: str or ~azure.ai.projects.models.HOSTED + :ivar cpu: The CPU configuration for the hosted agent. Required. + :vartype cpu: str + :ivar memory: The memory configuration for the hosted agent. Required. + :vartype memory: str + :ivar environment_variables: Environment variables to set in the hosted agent container. + :vartype environment_variables: dict[str, str] + :ivar container_configuration: Container-based deployment configuration. Provide this for + image-based deployments. Mutually exclusive with code_configuration — the service validates + that exactly one is set. + :vartype container_configuration: ~azure.ai.projects.models.ContainerConfiguration + :ivar protocol_versions: The protocols that the agent supports for ingress communication. + :vartype protocol_versions: list[~azure.ai.projects.models.ProtocolVersionRecord] + :ivar code_configuration: Code-based deployment configuration. Provide this for code-based + deployments. Mutually exclusive with container_configuration — the service validates that + exactly one is set. + :vartype code_configuration: ~azure.ai.projects.models.CodeConfiguration + :ivar telemetry_config: Optional customer-supplied telemetry configuration for exporting + container logs, traces, and metrics. + :vartype telemetry_config: ~azure.ai.projects.models.TelemetryConfig """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The action type. Required. Known values are: \"invoke_agent_responses_api\" and - \"invoke_agent_invocations_api\".""" + kind: Literal[AgentKind.HOSTED] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. HOSTED.""" + cpu: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The CPU configuration for the hosted agent. Required.""" + memory: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The memory configuration for the hosted agent. Required.""" + environment_variables: Optional[dict[str, str]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Environment variables to set in the hosted agent container.""" + container_configuration: Optional["_models.ContainerConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Container-based deployment configuration. Provide this for image-based deployments. Mutually + exclusive with code_configuration — the service validates that exactly one is set.""" + protocol_versions: Optional[list["_models.ProtocolVersionRecord"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The protocols that the agent supports for ingress communication.""" + code_configuration: Optional["_models.CodeConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Code-based deployment configuration. Provide this for code-based deployments. Mutually + exclusive with container_configuration — the service validates that exactly one is set.""" + telemetry_config: Optional["_models.TelemetryConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional customer-supplied telemetry configuration for exporting container logs, traces, and + metrics.""" @overload def __init__( self, *, - type: str, + cpu: str, + memory: str, + rai_config: Optional["_models.RaiConfig"] = None, + environment_variables: Optional[dict[str, str]] = None, + container_configuration: Optional["_models.ContainerConfiguration"] = None, + protocol_versions: Optional[list["_models.ProtocolVersionRecord"]] = None, + code_configuration: Optional["_models.CodeConfiguration"] = None, + telemetry_config: Optional["_models.TelemetryConfig"] = None, ) -> None: ... @overload @@ -8846,47 +8858,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.kind = AgentKind.HOSTED # type: ignore -class InvokeAgentInvocationsApiRoutineAction(RoutineAction, discriminator="invoke_agent_invocations_api"): - """Dispatches a routine through the raw invocations API. Exactly one of agent_name or - agent_endpoint_id must be provided. +class HourlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Hourly"): + """Hourly recurrence schedule. - :ivar type: The action type. Required. Dispatches through the raw invocations API. - :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_INVOCATIONS_API - :ivar agent_name: The project-scoped agent name for routine dispatch. - :vartype agent_name: str - :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. - :vartype agent_endpoint_id: str - :ivar input: Static JSON value sent as the complete downstream input when the routine fires. - The value is passed through as-is; no templating is applied. - :vartype input: any - :ivar session_id: An optional existing hosted-agent session identifier to continue during the - downstream dispatch. - :vartype session_id: str + :ivar type: Required. Hourly recurrence pattern. + :vartype type: str or ~azure.ai.projects.models.HOURLY """ - type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The action type. Required. Dispatches through the raw invocations API.""" - agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The project-scoped agent name for routine dispatch.""" - agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Legacy endpoint-scoped agent identifier for routine dispatch.""" - input: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Static JSON value sent as the complete downstream input when the routine fires. The value is - passed through as-is; no templating is applied.""" - session_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional existing hosted-agent session identifier to continue during the downstream - dispatch.""" + type: Literal[RecurrenceType.HOURLY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Hourly recurrence pattern.""" @overload def __init__( self, - *, - agent_name: Optional[str] = None, - agent_endpoint_id: Optional[str] = None, - input: Optional[Any] = None, - session_id: Optional[str] = None, ) -> None: ... @overload @@ -8898,32 +8885,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineActionType.INVOKE_AGENT_INVOCATIONS_API # type: ignore + self.type = RecurrenceType.HOURLY # type: ignore -class InvokeAgentResponsesApiDispatchPayload(RoutineDispatchPayload, discriminator="invoke_agent_responses_api"): - """A manual payload used to test a responses API routine dispatch. +class HumanEvaluationPreviewRuleAction(EvaluationRuleAction, discriminator="humanEvaluationPreview"): + """Evaluation rule action for human evaluation. - :ivar type: The manual dispatch payload type. Required. A manual payload for a responses API - routine dispatch. - :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_RESPONSES_API - :ivar input: The JSON value sent as the complete downstream responses input. The value is - passed through as-is and can be an object, string, number, boolean, array, or null. Required. - :vartype input: any + :ivar type: Required. Human evaluation preview. + :vartype type: str or ~azure.ai.projects.models.HUMAN_EVALUATION_PREVIEW + :ivar template_id: Human evaluation template Id. Required. + :vartype template_id: str """ - type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The manual dispatch payload type. Required. A manual payload for a responses API routine - dispatch.""" - input: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON value sent as the complete downstream responses input. The value is passed through - as-is and can be an object, string, number, boolean, array, or null. Required.""" + type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Human evaluation preview.""" + template_id: str = rest_field(name="templateId", visibility=["read", "create", "update", "delete", "query"]) + """Human evaluation template Id. Required.""" @overload def __init__( self, *, - input: Any, + template_id: str, ) -> None: ... @overload @@ -8935,47 +8918,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API # type: ignore + self.type = EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW # type: ignore -class InvokeAgentResponsesApiRoutineAction(RoutineAction, discriminator="invoke_agent_responses_api"): - """Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id - must be provided. +class HybridSearchOptions(_Model): + """HybridSearchOptions. - :ivar type: The action type. Required. Dispatches through the responses API. - :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_RESPONSES_API - :ivar agent_name: The project-scoped agent name for routine dispatch. - :vartype agent_name: str - :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. - :vartype agent_endpoint_id: str - :ivar input: Static JSON value sent as the complete downstream input when the routine fires. - The value is passed through as-is; no templating is applied. - :vartype input: any - :ivar conversation: An optional existing conversation identifier to continue during the - downstream dispatch. - :vartype conversation: str + :ivar embedding_weight: The weight of the embedding in the reciprocal ranking fusion. Required. + :vartype embedding_weight: float + :ivar text_weight: The weight of the text in the reciprocal ranking fusion. Required. + :vartype text_weight: float """ - type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The action type. Required. Dispatches through the responses API.""" - agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The project-scoped agent name for routine dispatch.""" - agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Legacy endpoint-scoped agent identifier for routine dispatch.""" - input: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Static JSON value sent as the complete downstream input when the routine fires. The value is - passed through as-is; no templating is applied.""" - conversation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional existing conversation identifier to continue during the downstream dispatch.""" + embedding_weight: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The weight of the embedding in the reciprocal ranking fusion. Required.""" + text_weight: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The weight of the text in the reciprocal ranking fusion. Required.""" @overload def __init__( self, *, - agent_name: Optional[str] = None, - agent_endpoint_id: Optional[str] = None, - input: Optional[Any] = None, - conversation: Optional[str] = None, + embedding_weight: float, + text_weight: float, ) -> None: ... @overload @@ -8987,14 +8952,57 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineActionType.INVOKE_AGENT_RESPONSES_API # type: ignore -class LocalShellToolParam(Tool, discriminator="local_shell"): - """Local shell tool. +class ImageGenTool(Tool, discriminator="image_generation"): + """Image generation tool. - :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 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"], str + :vartype model: 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: Background type for the generated image. One of ``transparent``, ``opaque``, + or ``auto``. 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 @@ -9005,8 +9013,66 @@ class LocalShellToolParam(Tool, discriminator="local_shell"): :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] """ - 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.""" + 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"], 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\"], 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"] + ) + """Background type for the generated image. One of ``transparent``, ``opaque``, or ``auto``. + 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"]) @@ -9020,6 +9086,21 @@ class LocalShellToolParam(Tool, discriminator="local_shell"): def __init__( self, *, + model: Optional[ + Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], 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, @@ -9034,26 +9115,61 @@ 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 = ToolType.IMAGE_GENERATION # type: ignore -class LocalSkillParam(_Model): - """LocalSkillParam. +class ImageGenToolInputImageMask(_Model): + """ImageGenToolInputImageMask. - :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 image_url: + :vartype image_url: str + :ivar file_id: + :vartype file_id: str """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + image_url: Optional[str] = None, + 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 InlineSkillParam(ContainerSkill, discriminator="inline"): + """InlineSkillParam. + + :ivar type: Defines an inline skill for this request. Required. INLINE. + :vartype type: str or ~azure.ai.projects.models.INLINE + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar description: The description of the skill. Required. + :vartype description: str + :ivar source: Inline skill payload. Required. + :vartype source: ~azure.ai.projects.models.InlineSkillSourceParam + """ + + type: Literal[ContainerSkillType.INLINE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Defines an inline skill for this request. Required. INLINE.""" + 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.""" + source: "_models.InlineSkillSourceParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inline skill payload. Required.""" @overload def __init__( @@ -9061,7 +9177,7 @@ def __init__( *, name: str, description: str, - path: str, + source: "_models.InlineSkillSourceParam", ) -> None: ... @overload @@ -9073,43 +9189,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ContainerSkillType.INLINE # type: ignore -class LoraConfig(_Model): - """Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment - time. +class InlineSkillSourceParam(_Model): + """Inline skill payload. - :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 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 """ - 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["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, *, - rank: Optional[int] = None, - alpha: Optional[int] = None, - target_modules: Optional[list[str]] = None, - dropout: Optional[float] = None, + data: str, ) -> None: ... @overload @@ -9121,27 +9229,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["base64"] = "base64" + self.media_type: Literal["application/zip"] = "application/zip" -class ManagedAgentIdentityBlueprintReference(AgentBlueprintReference, discriminator="ManagedAgentIdentityBlueprint"): - """ManagedAgentIdentityBlueprintReference. +class Insight(_Model): + """The response body for cluster insights. - :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 + :ivar insight_id: The unique identifier for the insights report. Required. + :vartype insight_id: str + :ivar metadata: Metadata about the insights report. Required. + :vartype metadata: ~azure.ai.projects.models.InsightsMetadata + :ivar state: The current state of the insights. Required. Known values are: "NotStarted", + "Running", "Succeeded", "Failed", and "Canceled". + :vartype state: str or ~azure.ai.projects.models.OperationState + :ivar display_name: User friendly display name for the insight. Required. + :vartype display_name: str + :ivar request: Request for the insights analysis. Required. + :vartype request: ~azure.ai.projects.models.InsightRequest + :ivar result: The result of the insights report. + :vartype result: ~azure.ai.projects.models.InsightResult """ - 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.""" + insight_id: str = rest_field(name="id", visibility=["read"]) + """The unique identifier for the insights report. Required.""" + metadata: "_models.InsightsMetadata" = rest_field(visibility=["read"]) + """Metadata about the insights report. Required.""" + state: Union[str, "_models.OperationState"] = rest_field(visibility=["read"]) + """The current state of the insights. Required. Known values are: \"NotStarted\", \"Running\", + \"Succeeded\", \"Failed\", and \"Canceled\".""" + display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"]) + """User friendly display name for the insight. Required.""" + request: "_models.InsightRequest" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Request for the insights analysis. Required.""" + result: Optional["_models.InsightResult"] = rest_field(visibility=["read"]) + """The result of the insights report.""" @overload def __init__( self, *, - blueprint_id: str, + display_name: str, + request: "_models.InsightRequest", ) -> None: ... @overload @@ -9153,40 +9282,66 @@ 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"): - """Managed Azure AI Search Index Definition. +class InsightCluster(_Model): + """A cluster of analysis samples. - :ivar id: Asset ID, a unique identifier for the asset. + :ivar id: The id of the analysis cluster. Required. :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. + :ivar label: Label for the cluster. Required. + :vartype label: str + :ivar suggestion: Suggestion for the cluster. Required. + :vartype suggestion: str + :ivar suggestion_title: The title of the suggestion for the cluster. Required. + :vartype suggestion_title: str + :ivar description: Description of the analysis cluster. Required. :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 weight: The weight of the analysis cluster. This indicate number of samples in the + cluster. Required. + :vartype weight: int + :ivar sub_clusters: List of subclusters within this cluster. Empty if no subclusters exist. + :vartype sub_clusters: list[~azure.ai.projects.models.InsightCluster] + :ivar samples: List of samples that belong to this cluster. Empty if samples are part of + subclusters. + :vartype samples: list[~azure.ai.projects.models.InsightSample] """ - 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.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the analysis cluster. Required.""" + label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Label for the cluster. Required.""" + suggestion: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Suggestion for the cluster. Required.""" + suggestion_title: str = rest_field( + name="suggestionTitle", visibility=["read", "create", "update", "delete", "query"] + ) + """The title of the suggestion for the cluster. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of the analysis cluster. Required.""" + weight: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The weight of the analysis cluster. This indicate number of samples in the cluster. Required.""" + sub_clusters: Optional[list["_models.InsightCluster"]] = rest_field( + name="subClusters", visibility=["read", "create", "update", "delete", "query"] + ) + """List of subclusters within this cluster. Empty if no subclusters exist.""" + samples: Optional[list["_models.InsightSample"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of samples that belong to this cluster. Empty if samples are part of subclusters.""" @overload def __init__( self, *, - vector_store_id: str, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + id: str, # pylint: disable=redefined-builtin + label: str, + suggestion: str, + suggestion_title: str, + description: str, + weight: int, + sub_clusters: Optional[list["_models.InsightCluster"]] = None, + samples: Optional[list["_models.InsightSample"]] = None, ) -> None: ... @overload @@ -9198,150 +9353,29 @@ 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 McpProtocolConfiguration(_Model): - """Configuration specific to the MCP protocol.""" +class InsightModelConfiguration(_Model): + """Configuration of the model used in the insight generation. + :ivar model_deployment_name: The model deployment to be evaluated. Accepts either the + deployment name alone or with the connection name as '{connectionName}/'. + Required. + :vartype model_deployment_name: str + """ -class MCPTool(Tool, discriminator="mcp"): - """MCP tool. + model_deployment_name: str = rest_field( + name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] + ) + """The model deployment to be evaluated. Accepts either the deployment name alone or with the + connection name as '{connectionName}/'. Required.""" - :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`` or ``connector_id`` must be - provided. - :vartype server_url: str - :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of - ``server_url`` or ``connector_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"] - :vartype connector_id: str or str or str or str or str or str or str or 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 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[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`` or ``connector_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`` or - ``connector_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\"]""" - 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.""" - 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, - *, - 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, - authorization: Optional[str] = None, - server_description: Optional[str] = None, - headers: Optional[dict[str, str]] = None, - allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = 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 + def __init__( + self, + *, + model_deployment_name: str, + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: @@ -9352,148 +9386,30 @@ 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"): - """An MCP 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. 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`` or ``connector_id`` must be - provided. - :vartype server_url: str - :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of - ``server_url`` or ``connector_id`` must be provided. Learn more about service connectors `here - `_. Currently supported ``connector_id`` values are: +class InsightScheduleTask(ScheduleTask, discriminator="Insight"): + """Insight task for the schedule. - * 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 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 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 configuration: Configuration for the task. + :vartype configuration: dict[str, str] + :ivar type: Required. Insight task. + :vartype type: str or ~azure.ai.projects.models.INSIGHT + :ivar insight: The insight payload. Required. + :vartype insight: ~azure.ai.projects.models.Insight """ - 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`` or ``connector_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`` or - ``connector_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\"]""" - 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.""" - 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.""" + type: Literal[ScheduleTaskType.INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Insight task.""" + insight: "_models.Insight" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The insight payload. 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, - authorization: Optional[str] = None, - server_description: Optional[str] = None, - headers: Optional[dict[str, str]] = None, - allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = None, - require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = None, - defer_loading: Optional[bool] = None, - project_connection_id: Optional[str] = None, + insight: "_models.Insight", + configuration: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -9505,35 +9421,33 @@ 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 = ScheduleTaskType.INSIGHT # type: ignore -class MCPToolFilter(_Model): - """MCP tool filter. +class InsightsMetadata(_Model): + """Metadata about the insights. - :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 created_at: The timestamp when the insights were created. Required. + :vartype created_at: ~datetime.datetime + :ivar completed_at: The timestamp when the insights were completed. + :vartype completed_at: ~datetime.datetime """ - 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.""" + created_at: datetime.datetime = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp when the insights were created. Required.""" + completed_at: Optional[datetime.datetime] = rest_field( + name="completedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp when the insights were completed.""" @overload def __init__( self, *, - tool_names: Optional[list[str]] = None, - read_only: Optional[bool] = None, + created_at: datetime.datetime, + completed_at: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -9547,24 +9461,45 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MCPToolRequireApproval(_Model): - """MCPToolRequireApproval. +class InsightSummary(_Model): + """Summary of the error cluster analysis. - :ivar always: - :vartype always: ~azure.ai.projects.models.MCPToolFilter - :ivar never: - :vartype never: ~azure.ai.projects.models.MCPToolFilter + :ivar sample_count: Total number of samples analyzed. Required. + :vartype sample_count: int + :ivar unique_subcluster_count: Total number of unique subcluster labels. Required. + :vartype unique_subcluster_count: int + :ivar unique_cluster_count: Total number of unique clusters. Required. + :vartype unique_cluster_count: int + :ivar method: Method used for clustering. Required. + :vartype method: str + :ivar usage: Token usage while performing clustering analysis. Required. + :vartype usage: ~azure.ai.projects.models.ClusterTokenUsage """ - always: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - never: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + sample_count: int = rest_field(name="sampleCount", visibility=["read", "create", "update", "delete", "query"]) + """Total number of samples analyzed. Required.""" + unique_subcluster_count: int = rest_field( + name="uniqueSubclusterCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Total number of unique subcluster labels. Required.""" + unique_cluster_count: int = rest_field( + name="uniqueClusterCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Total number of unique clusters. Required.""" + method: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Method used for clustering. Required.""" + usage: "_models.ClusterTokenUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Token usage while performing clustering analysis. Required.""" @overload def __init__( self, *, - always: Optional["_models.MCPToolFilter"] = None, - never: Optional["_models.MCPToolFilter"] = None, + sample_count: int, + unique_subcluster_count: int, + unique_cluster_count: int, + method: str, + usage: "_models.ClusterTokenUsage", ) -> None: ... @overload @@ -9578,30 +9513,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryOperation(_Model): - """Represents a single memory operation (create, update, or delete) performed on a memory item. +class InvocationsProtocolConfiguration(_Model): + """Configuration specific to the invocations protocol.""" - :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 + +class InvocationsWsProtocolConfiguration(_Model): + """Configuration specific to the WebSocket-based invocations protocol.""" + + +class RoutineDispatchPayload(_Model): + """Base model for a manual dispatch payload. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + InvokeAgentInvocationsApiDispatchPayload, InvokeAgentResponsesApiDispatchPayload + + :ivar type: The manual dispatch payload type. Required. Known values are: + "invoke_agent_responses_api" and "invoke_agent_invocations_api". + :vartype type: str or ~azure.ai.projects.models.RoutineDispatchPayloadType """ - 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.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The manual dispatch payload type. Required. Known values are: \"invoke_agent_responses_api\" + and \"invoke_agent_invocations_api\".""" @overload def __init__( self, *, - kind: Union[str, "_models.MemoryOperationKind"], - memory_item: "_models.MemoryItem", + type: str, ) -> None: ... @overload @@ -9615,21 +9555,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemorySearchItem(_Model): - """A retrieved memory item from memory search. +class InvokeAgentInvocationsApiDispatchPayload(RoutineDispatchPayload, discriminator="invoke_agent_invocations_api"): + """A manual payload used to test an invocations API routine dispatch. - :ivar memory_item: Retrieved memory item. Required. - :vartype memory_item: ~azure.ai.projects.models.MemoryItem + :ivar type: The manual dispatch payload type. Required. A manual payload for an invocations API + routine dispatch. + :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_INVOCATIONS_API + :ivar input: The JSON value sent as the complete downstream invocations input. The value is + passed through as-is and can be an object, string, number, boolean, array, or null. Required. + :vartype input: any """ - memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Retrieved memory item. Required.""" + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The manual dispatch payload type. Required. A manual payload for an invocations API routine + dispatch.""" + input: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON value sent as the complete downstream invocations input. The value is passed through + as-is and can be an object, string, number, boolean, array, or null. Required.""" @overload def __init__( self, *, - memory_item: "_models.MemoryItem", + input: Any, ) -> None: ... @overload @@ -9641,23 +9589,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API # type: ignore -class MemorySearchOptions(_Model): - """Memory search options. +class RoutineAction(_Model): + """Base model for a routine action. - :ivar max_memories: Maximum number of memory items to return. - :vartype max_memories: int + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + InvokeAgentInvocationsApiRoutineAction, InvokeAgentResponsesApiRoutineAction + + :ivar type: The action type. Required. Known values are: "invoke_agent_responses_api" and + "invoke_agent_invocations_api". + :vartype type: str or ~azure.ai.projects.models.RoutineActionType """ - max_memories: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of memory items to return.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The action type. Required. Known values are: \"invoke_agent_responses_api\" and + \"invoke_agent_invocations_api\".""" @overload def __init__( self, *, - max_memories: Optional[int] = None, + type: str, ) -> None: ... @overload @@ -9671,48 +9626,45 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemorySearchPreviewTool(Tool, discriminator="memory_search_preview"): - """A tool for integrating memories into the agent. +class InvokeAgentInvocationsApiRoutineAction(RoutineAction, discriminator="invoke_agent_invocations_api"): + """Dispatches a routine through the raw invocations API. Exactly one of agent_name or + agent_endpoint_id must be provided. - :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 type: The action type. Required. Dispatches through the raw invocations API. + :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_INVOCATIONS_API + :ivar agent_name: The project-scoped agent name for routine dispatch. + :vartype agent_name: str + :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. + :vartype agent_endpoint_id: str + :ivar input: Static JSON value sent as the complete downstream input when the routine fires. + The value is passed through as-is; no templating is applied. + :vartype input: any + :ivar session_id: An optional existing hosted-agent session identifier to continue during the + downstream dispatch. + :vartype session_id: str """ - 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.""" + type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The action type. Required. Dispatches through the raw invocations API.""" + agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The project-scoped agent name for routine dispatch.""" + agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Legacy endpoint-scoped agent identifier for routine dispatch.""" + input: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Static JSON value sent as the complete downstream input when the routine fires. The value is + passed through as-is; no templating is applied.""" + session_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional existing hosted-agent session identifier to continue during the downstream + dispatch.""" @overload def __init__( self, *, - memory_store_name: str, - scope: str, - search_options: Optional["_models.MemorySearchOptions"] = None, - update_delay: Optional[int] = None, + agent_name: Optional[str] = None, + agent_endpoint_id: Optional[str] = None, + input: Optional[Any] = None, + session_id: Optional[str] = None, ) -> None: ... @overload @@ -9724,28 +9676,32 @@ 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 = RoutineActionType.INVOKE_AGENT_INVOCATIONS_API # type: ignore -class MemoryStoreDefinition(_Model): - """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 InvokeAgentResponsesApiDispatchPayload(RoutineDispatchPayload, discriminator="invoke_agent_responses_api"): + """A manual payload used to test a responses API routine dispatch. - :ivar kind: The kind of the memory store. Required. "default" - :vartype kind: str or ~azure.ai.projects.models.MemoryStoreKind + :ivar type: The manual dispatch payload type. Required. A manual payload for a responses API + routine dispatch. + :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_RESPONSES_API + :ivar input: The JSON value sent as the complete downstream responses input. The value is + passed through as-is and can be an object, string, number, boolean, array, or null. Required. + :vartype input: any """ - __mapping__: dict[str, _Model] = {} - kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) - """The kind of the memory store. Required. \"default\"""" + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The manual dispatch payload type. Required. A manual payload for a responses API routine + dispatch.""" + input: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON value sent as the complete downstream responses input. The value is passed through + as-is and can be an object, string, number, boolean, array, or null. Required.""" @overload def __init__( self, *, - kind: str, + input: Any, ) -> None: ... @overload @@ -9757,40 +9713,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API # type: ignore -class MemoryStoreDefaultDefinition(MemoryStoreDefinition, discriminator="default"): - """Default memory store implementation. +class InvokeAgentResponsesApiRoutineAction(RoutineAction, discriminator="invoke_agent_responses_api"): + """Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id + must be provided. - :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 type: The action type. Required. Dispatches through the responses API. + :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_RESPONSES_API + :ivar agent_name: The project-scoped agent name for routine dispatch. + :vartype agent_name: str + :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. + :vartype agent_endpoint_id: str + :ivar input: Static JSON value sent as the complete downstream input when the routine fires. + The value is passed through as-is; no templating is applied. + :vartype input: any + :ivar conversation: An optional existing conversation identifier to continue during the + downstream dispatch. + :vartype conversation: str """ - 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.""" + type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The action type. Required. Dispatches through the responses API.""" + agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The project-scoped agent name for routine dispatch.""" + agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Legacy endpoint-scoped agent identifier for routine dispatch.""" + input: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Static JSON value sent as the complete downstream input when the routine fires. The value is + passed through as-is; no templating is applied.""" + conversation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional existing conversation identifier to continue during the downstream dispatch.""" @overload def __init__( self, *, - chat_model: str, - embedding_model: str, - options: Optional["_models.MemoryStoreDefaultOptions"] = None, + agent_name: Optional[str] = None, + agent_endpoint_id: Optional[str] = None, + input: Optional[Any] = None, + conversation: Optional[str] = None, ) -> None: ... @overload @@ -9802,53 +9765,42 @@ 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 = RoutineActionType.INVOKE_AGENT_RESPONSES_API # type: ignore -class MemoryStoreDefaultOptions(_Model): - """Default memory store configurations. +class LocalShellToolParam(Tool, discriminator="local_shell"): + """Local shell tool. - :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 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] """ - 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" + 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"] ) - """The default time-to-live for memories in seconds. A value of ``0`` indicates that memories do - not expire. Defaults to ``0``.""" + """Deprecated. This property is deprecated and will be removed in a future version.""" @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, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -9860,41 +9812,34 @@ 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 -class MemoryStoreDeleteScopeResult(_Model): - """Response for deleting memories from a scope. +class LocalSkillParam(_Model): + """LocalSkillParam. - :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. + :ivar name: The name of the skill. 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 description: The description of the skill. Required. + :vartype description: str + :ivar path: The path to the directory containing the skill. Required. + :vartype path: 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.""" + """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, *, - object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], name: str, - scope: str, - deleted: bool, + description: str, + path: str, ) -> None: ... @overload @@ -9908,63 +9853,41 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreDetails(_Model): - """A memory store that can store and retrieve user memories. +class LoraConfig(_Model): + """Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment + time. - :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 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 """ - 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" + 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 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.""" + """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, *, - 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, + rank: Optional[int] = None, + alpha: Optional[int] = None, + target_modules: Optional[list[str]] = None, + dropout: Optional[float] = None, ) -> None: ... @overload @@ -9978,90 +9901,377 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreOperationUsage(_Model): - """Usage statistics of a memory store operation. +class ManagedAgentIdentityBlueprintReference(AgentBlueprintReference, discriminator="ManagedAgentIdentityBlueprint"): + """ManagedAgentIdentityBlueprintReference. - :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. 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 """ - 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( + 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, + *, + blueprint_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 = AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT # type: ignore + + +class ManagedAzureAISearchIndex(Index, discriminator="ManagedAzureSearch"): + """Managed Azure AI Search Index Definition. + + :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 + """ + + 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, + *, + vector_store_id: str, + description: Optional[str] = None, + tags: 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) + self.type = IndexType.MANAGED_AZURE_SEARCH # type: ignore + + +class McpProtocolConfiguration(_Model): + """Configuration specific to the MCP protocol.""" + + +class MCPTool(Tool, discriminator="mcp"): + """MCP tool. + + :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`` or ``connector_id`` must be + provided. + :vartype server_url: str + :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of + ``server_url`` or ``connector_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"] + :vartype connector_id: str or str or str or str or str or str or str or 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 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[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`` or ``connector_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`` or + ``connector_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\"]""" + 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.""" + 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, + *, + 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, + authorization: Optional[str] = None, + server_description: Optional[str] = None, + headers: Optional[dict[str, str]] = None, + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = 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 + 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.MCP # type: ignore + + +class MCPToolboxTool(ToolboxTool, discriminator="mcp"): + """An MCP 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. 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`` or ``connector_id`` must be + provided. + :vartype server_url: str + :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of + ``server_url`` or ``connector_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"] + :vartype connector_id: str or str or str or str or str or str or str or 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 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[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`` or ``connector_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`` or + ``connector_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\"]""" + 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"] ) - """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"] + """Is either a [str] type or a MCPToolFilter type.""" + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = ( + 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, - *, - embedding_tokens: int, - input_tokens: int, - input_tokens_details: "_models.ResponseUsageInputTokensDetails", - output_tokens: int, - output_tokens_details: "_models.ResponseUsageOutputTokensDetails", - 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 MemoryStoreSearchResult(_Model): - """Memory search response. - - :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 - """ - - 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.""" + """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, *, - search_id: str, - memories: list["_models.MemorySearchItem"], - usage: "_models.MemoryStoreOperationUsage", + 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, + authorization: Optional[str] = None, + server_description: Optional[str] = None, + headers: Optional[dict[str, str]] = None, + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = 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 @@ -10073,31 +10283,35 @@ 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 -class MemoryStoreUpdateCompletedResult(_Model): - """Memory update result. +class MCPToolFilter(_Model): + """MCP tool filter. - :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 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 """ - 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.""" + 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, *, - memory_operations: list["_models.MemoryOperation"], - usage: "_models.MemoryStoreOperationUsage", + tool_names: Optional[list[str]] = None, + read_only: Optional[bool] = None, ) -> None: ... @overload @@ -10111,51 +10325,24 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreUpdateResult(_Model): - """Provides the status of a memory store update operation. +class MCPToolRequireApproval(_Model): + """MCPToolRequireApproval. - :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 always: + :vartype always: ~azure.ai.projects.models.MCPToolFilter + :ivar never: + :vartype never: ~azure.ai.projects.models.MCPToolFilter """ - 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\".""" + 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, *, - update_id: str, - status: Union[str, "_models.MemoryStoreUpdateStatus"], - superseded_by: Optional[str] = None, - result: Optional["_models.MemoryStoreUpdateCompletedResult"] = None, - error: Optional["_models.ApiError"] = None, + always: Optional["_models.MCPToolFilter"] = None, + never: Optional["_models.MCPToolFilter"] = None, ) -> None: ... @overload @@ -10169,29 +10356,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MicrosoftFabricPreviewTool(Tool, discriminator="fabric_dataagent_preview"): - """The input definition information for a Microsoft Fabric tool as used to configure an agent. +class MemoryOperation(_Model): + """Represents a single memory operation (create, update, or delete) performed on a memory item. - :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 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[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( + kind: Union[str, "_models.MemoryOperationKind"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The fabric data agent tool parameters. Required.""" + """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, *, - fabric_dataagent_preview: "_models.FabricDataAgentToolParameters", + kind: Union[str, "_models.MemoryOperationKind"], + memory_item: "_models.MemoryItem", ) -> None: ... @overload @@ -10203,24 +10391,23 @@ 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 -class ModelCredentialRequest(_Model): - """Request to fetch credentials for a model asset. +class MemorySearchItem(_Model): + """A retrieved memory item from memory search. - :ivar blob_uri: Blob URI of the model asset to fetch credentials for. Required. - :vartype blob_uri: str + :ivar memory_item: Retrieved memory item. Required. + :vartype memory_item: ~azure.ai.projects.models.MemoryItem """ - blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) - """Blob URI of the model asset to fetch credentials for. Required.""" + memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Retrieved memory item. Required.""" @overload def __init__( self, *, - blob_uri: str, + memory_item: "_models.MemoryItem", ) -> None: ... @overload @@ -10234,45 +10421,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelDeployment(Deployment, discriminator="ModelDeployment"): - """Model Deployment Definition. +class MemorySearchOptions(_Model): + """Memory search options. - :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 + :ivar max_memories: Maximum number of memory items to return. + :vartype max_memories: int """ - 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.""" + max_memories: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of memory items to return.""" @overload def __init__( self, + *, + max_memories: Optional[int] = None, ) -> None: ... @overload @@ -10284,44 +10447,50 @@ 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 -class ModelDeploymentSku(_Model): - """Sku information. +class MemorySearchPreviewTool(Tool, discriminator="memory_search_preview"): + """A tool for integrating memories into the agent. - :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 + :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 """ - 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.""" + 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, *, - capacity: int, - family: str, - name: str, - size: str, - tier: str, + memory_store_name: str, + scope: str, + search_options: Optional["_models.MemorySearchOptions"] = None, + update_delay: Optional[int] = None, ) -> None: ... @overload @@ -10333,42 +10502,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 ModelPendingUploadRequest(_Model): - """Represents a request for a pending upload of a model version. +class MemoryStoreDefinition(_Model): + """Base definition for memory store configurations. - :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 + 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 """ - 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.""" + __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, *, - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], - pending_upload_id: Optional[str] = None, - connection_name: Optional[str] = None, + kind: str, ) -> None: ... @overload @@ -10382,45 +10537,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelPendingUploadResponse(_Model): - """Represents the response for a model pending upload request. +class MemoryStoreDefaultDefinition(MemoryStoreDefinition, discriminator="default"): + """Default memory store implementation. - :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 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 """ - 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.""" + 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, *, - blob_reference: "_models.BlobReference", - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], - version: Optional[str] = None, + chat_model: str, + embedding_model: str, + options: Optional["_models.MemoryStoreDefaultOptions"] = None, ) -> None: ... @overload @@ -10432,39 +10580,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 ModelSamplingParams(_Model): - """Represents a set of parameters used to control the sampling behavior of a language model during - text generation. +class MemoryStoreDefaultOptions(_Model): + """Default memory store configurations. - :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 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 """ - 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.""" + 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, *, - temperature: Optional[float] = None, - top_p: Optional[float] = None, - seed: Optional[int] = None, - max_completion_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 @@ -10478,29 +10640,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelSourceData(_Model): - """Source information for the model. +class MemoryStoreDeleteScopeResult(_Model): + """Response for deleting memories from a scope. - :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 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 """ - source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = rest_field( - name="sourceType", visibility=["read", "create", "update", "delete", "query"] + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED] = rest_field( + 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.""" + """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, *, - source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = None, - job_id: Optional[str] = None, + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], + name: str, + scope: str, + deleted: bool, ) -> None: ... @overload @@ -10514,78 +10686,63 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelVersion(_Model): - """Model Version Definition. +class MemoryStoreDetails(_Model): + """A memory store that can store and retrieve user memories. - :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 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 name: The name of the resource. Required. + :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 version: The version of the resource. Required. - :vartype version: str - :ivar description: The asset description text. + :ivar description: A human-readable description of the memory store. :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, 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 """ - 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"] + object: Literal[MemoryStoreObjectType.MEMORY_STORE] = 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.""" + """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, *, - 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, + 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, - tags: Optional[dict[str, str]] = None, + metadata: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -10599,27 +10756,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MonthlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Monthly"): - """Monthly recurrence schedule. +class MemoryStoreOperationUsage(_Model): + """Usage statistics of a memory store operation. - :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 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 """ - 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"] + 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"] ) - """Days of the month for the recurrence schedule. Required.""" + """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, *, - days_of_month: list[int], + embedding_tokens: int, + input_tokens: int, + input_tokens_details: "_models.ResponseUsageInputTokensDetails", + output_tokens: int, + output_tokens_details: "_models.ResponseUsageOutputTokensDetails", + total_tokens: int, ) -> None: ... @overload @@ -10631,41 +10811,35 @@ 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 -class NamespaceToolParam(Tool, discriminator="namespace"): - """Namespace. +class MemoryStoreSearchResult(_Model): + """Memory search response. - :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 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 """ - 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.""" + 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, *, - name: str, - description: str, - tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]], + search_id: str, + memories: list["_models.MemorySearchItem"], + usage: "_models.MemoryStoreOperationUsage", ) -> None: ... @overload @@ -10677,22 +10851,31 @@ 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 MemoryStoreUpdateCompletedResult(_Model): + """Memory update result. - :ivar type: The credential type. Required. No credential. - :vartype type: str or ~azure.ai.projects.models.NONE + :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 """ - type: Literal[CredentialType.NONE] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. No credential.""" + 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, + *, + memory_operations: list["_models.MemoryOperation"], + usage: "_models.MemoryStoreOperationUsage", ) -> None: ... @overload @@ -10704,35 +10887,53 @@ 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 -class OneTimeTrigger(Trigger, discriminator="OneTime"): - """One-time trigger. +class MemoryStoreUpdateResult(_Model): + """Provides the status of a memory store update operation. - :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 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 """ - 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" + 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"] ) - """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``.""" + """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, *, - trigger_at: datetime.datetime, - time_zone: 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 @@ -10744,30 +10945,31 @@ 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): - """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 MicrosoftFabricPreviewTool(Tool, discriminator="fabric_dataagent_preview"): + """The input definition information for a Microsoft Fabric tool as used to configure an agent. - :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 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 """ - __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\".""" + 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"] + ) + """The fabric data agent tool parameters. Required.""" @overload def __init__( self, *, - type: str, + fabric_dataagent_preview: "_models.FabricDataAgentToolParameters", ) -> None: ... @overload @@ -10779,21 +10981,24 @@ 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 -class OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator="anonymous"): - """Security details for OpenApi anonymous authentication. +class ModelCredentialRequest(_Model): + """Request to fetch credentials for a model asset. - :ivar type: The object type, which is always 'anonymous'. Required. ANONYMOUS. - :vartype type: str or ~azure.ai.projects.models.ANONYMOUS + :ivar blob_uri: Blob URI of the model asset to fetch credentials for. Required. + :vartype blob_uri: 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.""" + 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, + *, + blob_uri: str, ) -> None: ... @overload @@ -10805,50 +11010,47 @@ 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): - """The input definition information for an openapi function. +class ModelDeployment(Deployment, discriminator="ModelDeployment"): + """Model Deployment Definition. - :ivar name: The name of the function to be called. Required. + :ivar name: Name of the deployment. 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 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 """ - 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.""" + 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, - *, - name: str, - spec: dict[str, Any], - auth: "_models.OpenApiAuthDetails", - description: Optional[str] = None, - default_params: Optional[list[str]] = None, ) -> None: ... @overload @@ -10860,36 +11062,44 @@ 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 -class OpenApiFunctionDefinitionFunction(_Model): - """OpenApiFunctionDefinitionFunction. +class ModelDeploymentSku(_Model): + """Sku information. - :ivar name: The name of the function to be called. Required. + :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 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] + :ivar size: Sku size. Required. + :vartype size: str + :ivar tier: Sku tier. Required. + :vartype tier: str """ + 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"]) - """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.""" + """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, *, + capacity: int, + family: str, name: str, - parameters: dict[str, Any], - description: Optional[str] = None, + size: str, + tier: str, ) -> None: ... @overload @@ -10903,27 +11113,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator="managed_identity"): - """Security details for OpenApi managed_identity authentication. +class ModelPendingUploadRequest(_Model): + """Represents a request for a pending upload of a model version. - :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 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 """ - 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"] + pending_upload_id: Optional[str] = rest_field( + name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] ) - """Connection auth security details. Required.""" + """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, *, - security_scheme: "_models.OpenApiManagedSecurityScheme", + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], + pending_upload_id: Optional[str] = None, + connection_name: Optional[str] = None, ) -> None: ... @overload @@ -10935,24 +11158,47 @@ 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 -class OpenApiManagedSecurityScheme(_Model): - """Security scheme for OpenApi managed_identity authentication. +class ModelPendingUploadResponse(_Model): + """Represents the response for a model pending upload request. - :ivar audience: Authentication scope for managed_identity auth type. Required. - :vartype audience: 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 """ - audience: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Authentication scope for managed_identity auth type. 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, *, - audience: str, + blob_reference: "_models.BlobReference", + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], + version: Optional[str] = None, ) -> None: ... @overload @@ -10966,28 +11212,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiProjectConnectionAuthDetails(OpenApiAuthDetails, discriminator="project_connection"): - """Security details for OpenApi project connection authentication. +class ModelSamplingParams(_Model): + """Represents a set of parameters used to control the sampling behavior of a language model during + text generation. - :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 + :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 """ - 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.""" + 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, *, - security_scheme: "_models.OpenApiProjectConnectionSecurityScheme", + temperature: Optional[float] = None, + top_p: Optional[float] = None, + seed: Optional[int] = None, + max_completion_tokens: Optional[int] = None, ) -> None: ... @overload @@ -10999,24 +11254,31 @@ 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 -class OpenApiProjectConnectionSecurityScheme(_Model): - """Security scheme for OpenApi managed_identity authentication. +class ModelSourceData(_Model): + """Source information for the model. - :ivar project_connection_id: Project connection id for Project Connection auth type. Required. - :vartype project_connection_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 """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Project connection id for Project Connection auth type. 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, *, - project_connection_id: str, + source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = None, + job_id: Optional[str] = None, ) -> None: ... @overload @@ -11030,35 +11292,78 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiTool(Tool, discriminator="openapi"): - """The input definition information for an OpenAPI tool as used to configure an agent. +class ModelVersion(_Model): + """Model Version Definition. - :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 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] """ - 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"] + 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 openapi function definition. Required.""" + """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, *, - openapi: "_models.OpenApiFunctionDefinition", - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + 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 @@ -11070,41 +11375,29 @@ 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 -class OpenApiToolboxTool(ToolboxTool, discriminator="openapi"): - """An OpenAPI tool stored in a toolbox. +class MonthlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Monthly"): + """Monthly recurrence schedule. - :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. 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 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] """ - 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"] + 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"] ) - """The openapi function definition. Required.""" + """Days of the month for the recurrence schedule. Required.""" @overload def __init__( self, *, - openapi: "_models.OpenApiFunctionDefinition", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + days_of_month: list[int], ) -> None: ... @overload @@ -11116,30 +11409,41 @@ 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 + self.type = RecurrenceType.MONTHLY # type: ignore -class OptimizationAgentIdentifier(_Model): - """Identifies the registered Foundry agent to optimize (request-only). Skills, tools, and - system_prompt are specified in options.optimization_config. +class NamespaceToolParam(Tool, discriminator="namespace"): + """Namespace. - :ivar agent_name: Registered Foundry agent name (required). Required. - :vartype agent_name: str - :ivar agent_version: Pinned agent version. Defaults to latest if omitted. - :vartype agent_version: str + :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] """ - agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Registered Foundry agent name (required). Required.""" - agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Pinned agent version. Defaults to latest if omitted.""" + 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.""" @overload def __init__( self, *, - agent_name: str, - agent_version: Optional[str] = None, + name: str, + description: str, + tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]], ) -> None: ... @overload @@ -11151,61 +11455,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 OptimizationCandidate(_Model): - """Aggregated evaluation result for a single candidate agent configuration across all tasks. +class NoAuthenticationCredentials(BaseCredentials, discriminator="None"): + """Credentials that do not require authentication. - :ivar candidate_id: Server-assigned candidate identifier. Use with GET /candidates/{id} - sub-endpoints. - :vartype candidate_id: str - :ivar name: Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required. - :vartype name: str - :ivar mutations: What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}). - :vartype mutations: dict[str, any] - :ivar avg_score: Average composite score across all tasks. Required. - :vartype avg_score: float - :ivar avg_tokens: Average token usage across all tasks. Required. - :vartype avg_tokens: float - :ivar eval_id: Foundry evaluation identifier used to score this candidate. - :vartype eval_id: str - :ivar eval_run_id: Foundry evaluation run identifier for this candidate's scoring run. - :vartype eval_run_id: str - :ivar promotion: Promotion metadata. Null if the candidate has not been promoted. - :vartype promotion: ~azure.ai.projects.models.PromotionInfo + :ivar type: The credential type. Required. No credential. + :vartype type: str or ~azure.ai.projects.models.NONE """ - candidate_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Server-assigned candidate identifier. Use with GET /candidates/{id} sub-endpoints.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required.""" - mutations: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}).""" - avg_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Average composite score across all tasks. Required.""" - avg_tokens: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Average token usage across all tasks. Required.""" - eval_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Foundry evaluation identifier used to score this candidate.""" - eval_run_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Foundry evaluation run identifier for this candidate's scoring run.""" - promotion: Optional["_models.PromotionInfo"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Promotion metadata. Null if the candidate has not been promoted.""" + type: Literal[CredentialType.NONE] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. No credential.""" @overload def __init__( self, - *, - name: str, - avg_score: float, - avg_tokens: float, - candidate_id: Optional[str] = None, - mutations: Optional[dict[str, Any]] = None, - eval_id: Optional[str] = None, - eval_run_id: Optional[str] = None, - promotion: Optional["_models.PromotionInfo"] = None, ) -> None: ... @overload @@ -11217,28 +11482,35 @@ 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 -class OptimizationDatasetCriterion(_Model): - """Evaluation criterion: a name + instruction pair used for per-item scoring. +class OneTimeTrigger(Trigger, discriminator="OneTime"): + """One-time trigger. - :ivar name: Criterion name. Required. - :vartype name: str - :ivar instruction: Criterion instruction / description. Required. - :vartype instruction: str + :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 """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Criterion name. Required.""" - instruction: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Criterion instruction / description. 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, *, - name: str, - instruction: str, + trigger_at: datetime.datetime, + time_zone: Optional[str] = None, ) -> None: ... @overload @@ -11250,22 +11522,24 @@ 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 OptimizationDatasetInput(_Model): - """Base discriminated model for dataset input. Either inline items or a registered reference. +class OpenApiAuthDetails(_Model): + """authentication details for OpenApiFunctionDefinition. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - OptimizationInlineDatasetInput, OptimizationReferenceDatasetInput + OpenApiAnonymousAuthDetails, OpenApiManagedAuthDetails, OpenApiProjectConnectionAuthDetails - :ivar type: Dataset input type discriminator. Required. Known values are: "inline" and - "reference". - :vartype type: str or ~azure.ai.projects.models.OptimizationDatasetInputType + :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 """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Dataset input type discriminator. Required. Known values are: \"inline\" and \"reference\".""" + """The type of authentication, must be anonymous/project_connection/managed_identity. Required. + Known values are: \"anonymous\", \"project_connection\", and \"managed_identity\".""" @overload def __init__( @@ -11285,38 +11559,19 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OptimizationDatasetItem(_Model): - """A single item in an inline dataset. +class OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator="anonymous"): + """Security details for OpenApi anonymous authentication. - :ivar query: The user query / prompt. - :vartype query: str - :ivar ground_truth: Expected ground truth answer. - :vartype ground_truth: str - :ivar desired_num_turns: Desired number of conversation turns for simulation mode (1-20). - :vartype desired_num_turns: int - :ivar criteria: Per-item evaluation criteria. - :vartype criteria: list[~azure.ai.projects.models.OptimizationDatasetCriterion] + :ivar type: The object type, which is always 'anonymous'. Required. ANONYMOUS. + :vartype type: str or ~azure.ai.projects.models.ANONYMOUS """ - query: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The user query / prompt.""" - ground_truth: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Expected ground truth answer.""" - desired_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Desired number of conversation turns for simulation mode (1-20).""" - criteria: Optional[list["_models.OptimizationDatasetCriterion"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Per-item evaluation criteria.""" + 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, - *, - query: Optional[str] = None, - ground_truth: Optional[str] = None, - desired_num_turns: Optional[int] = None, - criteria: Optional[list["_models.OptimizationDatasetCriterion"]] = None, ) -> None: ... @overload @@ -11328,28 +11583,50 @@ 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 OptimizationEvaluatorRef(_Model): - """Reference to a named evaluator, optionally pinned to a version. +class OpenApiFunctionDefinition(_Model): + """The input definition information for an openapi function. - :ivar name: Evaluator name. Required. + :ivar name: The name of the function to be called. Required. :vartype name: str - :ivar version: Evaluator version. If not specified, the latest version is used. - :vartype version: 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] """ name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Evaluator name. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Evaluator version. If not specified, the latest version is used.""" + """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, *, name: str, - version: Optional[str] = None, + spec: dict[str, Any], + auth: "_models.OpenApiAuthDetails", + description: Optional[str] = None, + default_params: Optional[list[str]] = None, ) -> None: ... @overload @@ -11363,29 +11640,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OptimizationInlineDatasetInput(OptimizationDatasetInput, discriminator="inline"): - """Inline dataset — items supplied directly in the request body. +class OpenApiFunctionDefinitionFunction(_Model): + """OpenApiFunctionDefinitionFunction. - :ivar type: Dataset input type discriminator. Required. Inline dataset — items are provided - directly in the request body. - :vartype type: str or ~azure.ai.projects.models.INLINE - :ivar dataset_items: Dataset items. Required. - :vartype dataset_items: list[~azure.ai.projects.models.OptimizationDatasetItem] + :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: Literal[OptimizationDatasetInputType.INLINE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Dataset input type discriminator. Required. Inline dataset — items are provided directly in the - request body.""" - dataset_items: list["_models.OptimizationDatasetItem"] = rest_field( - name="items", visibility=["read", "create", "update", "delete", "query"] - ) - """Dataset items. 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.""" + 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, *, - dataset_items: list["_models.OptimizationDatasetItem"], + name: str, + parameters: dict[str, Any], + description: Optional[str] = None, ) -> None: ... @overload @@ -11397,64 +11679,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OptimizationDatasetInputType.INLINE # type: ignore -class OptimizationJob(_Model): - """Agent optimization job resource — a long-running job that optimizes an agent's configuration - (instructions, model, skills, tools) to maximize evaluation scores. On success, the result - contains scored candidates. +class OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator="managed_identity"): + """Security details for OpenApi managed_identity authentication. - :ivar id: Server-assigned unique identifier. Required. - :vartype id: str - :ivar inputs: Caller-supplied inputs. - :vartype inputs: ~azure.ai.projects.models.OptimizationJobInputs - :ivar result: Result produced on success. - :vartype result: ~azure.ai.projects.models.OptimizationJobResult - :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 created_at: The timestamp when the job was created, represented in Unix time. Required. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. - Required. - :vartype updated_at: ~datetime.datetime - :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known - progress. - :vartype progress: ~azure.ai.projects.models.OptimizationJobProgress - :ivar warnings: Non-fatal warnings emitted at any point during optimization. - :vartype warnings: list[str] + :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 """ - id: str = rest_field(visibility=["read"]) - """Server-assigned unique identifier. Required.""" - inputs: Optional["_models.OptimizationJobInputs"] = 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"] ) - """Caller-supplied inputs.""" - result: Optional["_models.OptimizationJobResult"] = rest_field(visibility=["read"]) - """Result produced on success.""" - status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) - """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", - \"succeeded\", \"failed\", and \"cancelled\".""" - error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) - """Error details — populated only on failure.""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was created, represented in Unix time. Required.""" - updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was last updated, represented in Unix time. Required.""" - progress: Optional["_models.OptimizationJobProgress"] = rest_field(visibility=["read"]) - """Progress snapshot. May be present in terminal states reflecting last-known progress.""" - warnings: Optional[list[str]] = rest_field(visibility=["read"]) - """Non-fatal warnings emitted at any point during optimization.""" + """Connection auth security details. Required.""" @overload def __init__( self, *, - inputs: Optional["_models.OptimizationJobInputs"] = None, + security_scheme: "_models.OpenApiManagedSecurityScheme", ) -> None: ... @overload @@ -11466,58 +11713,24 @@ 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 -class OptimizationJobInputs(_Model): - """Caller-supplied inputs for an optimization job. +class OpenApiManagedSecurityScheme(_Model): + """Security scheme for OpenApi managed_identity authentication. - :ivar agent: The agent (and pinned version) being optimized. Required. - :vartype agent: ~azure.ai.projects.models.OptimizationAgentIdentifier - :ivar train_dataset: Training dataset — either inline items or a reference to a registered - dataset. Required. Required. - :vartype train_dataset: ~azure.ai.projects.models.OptimizationDatasetInput - :ivar validation_dataset: Optional held-out validation dataset for measuring generalization of - the final candidate. - :vartype validation_dataset: ~azure.ai.projects.models.OptimizationDatasetInput - :ivar evaluators: Job-level evaluators referenced by name and optional version. Required; at - least one must be provided. Required. - :vartype evaluators: list[~azure.ai.projects.models.OptimizationEvaluatorRef] - :ivar options: Tuning knobs and run-mode. - :vartype options: ~azure.ai.projects.models.OptimizationOptions + :ivar audience: Authentication scope for managed_identity auth type. Required. + :vartype audience: str """ - agent: "_models.OptimizationAgentIdentifier" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The agent (and pinned version) being optimized. Required.""" - train_dataset: "_models.OptimizationDatasetInput" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Training dataset — either inline items or a reference to a registered dataset. Required. - Required.""" - validation_dataset: Optional["_models.OptimizationDatasetInput"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional held-out validation dataset for measuring generalization of the final candidate.""" - evaluators: list["_models.OptimizationEvaluatorRef"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Job-level evaluators referenced by name and optional version. Required; at least one must be - provided. Required.""" - options: Optional["_models.OptimizationOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Tuning knobs and run-mode.""" + audience: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Authentication scope for managed_identity auth type. Required.""" @overload def __init__( self, *, - agent: "_models.OptimizationAgentIdentifier", - train_dataset: "_models.OptimizationDatasetInput", - evaluators: list["_models.OptimizationEvaluatorRef"], - validation_dataset: Optional["_models.OptimizationDatasetInput"] = None, - options: Optional["_models.OptimizationOptions"] = None, + audience: str, ) -> None: ... @overload @@ -11531,72 +11744,57 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OptimizationJobListItem(_Model): - """Slim job representation returned by the LIST endpoint. +class OpenApiProjectConnectionAuthDetails(OpenApiAuthDetails, discriminator="project_connection"): + """Security details for OpenApi project connection authentication. - :ivar id: Server-assigned unique identifier. Required. - :vartype id: str - :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 created_at: The timestamp when the job was created, represented in Unix time. Required. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. - Required. - :vartype updated_at: ~datetime.datetime - :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known - progress. - :vartype progress: ~azure.ai.projects.models.OptimizationJobProgress - :ivar agent: The agent targeted by this optimization job. - :vartype agent: ~azure.ai.projects.models.OptimizationAgentIdentifier + :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 """ - id: str = rest_field(visibility=["read"]) - """Server-assigned unique identifier. Required.""" - status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) - """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", - \"succeeded\", \"failed\", and \"cancelled\".""" - error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) - """Error details — populated only on failure.""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was created, represented in Unix time. Required.""" - updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was last updated, represented in Unix time. Required.""" - progress: Optional["_models.OptimizationJobProgress"] = rest_field(visibility=["read"]) - """Progress snapshot. May be present in terminal states reflecting last-known progress.""" - agent: Optional["_models.OptimizationAgentIdentifier"] = rest_field(visibility=["read"]) - """The agent targeted by this optimization job.""" + 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.""" + + @overload + def __init__( + self, + *, + security_scheme: "_models.OpenApiProjectConnectionSecurityScheme", + ) -> 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 = OpenApiAuthType.PROJECT_CONNECTION # type: ignore -class OptimizationJobProgress(_Model): - """In-flight progress; only populated while status is queued or in_progress. - :ivar candidates_completed: Number of candidates whose evaluation has completed so far. - Required. - :vartype candidates_completed: int - :ivar best_score: Best score observed so far across all candidates. Required. - :vartype best_score: float - :ivar elapsed_seconds: Wall-clock time elapsed in seconds since the job began executing. - Required. - :vartype elapsed_seconds: float +class OpenApiProjectConnectionSecurityScheme(_Model): + """Security scheme for OpenApi managed_identity authentication. + + :ivar project_connection_id: Project connection id for Project Connection auth type. Required. + :vartype project_connection_id: str """ - candidates_completed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of candidates whose evaluation has completed so far. Required.""" - best_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Best score observed so far across all candidates. Required.""" - elapsed_seconds: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Wall-clock time elapsed in seconds since the job began executing. 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, *, - candidates_completed: int, - best_score: float, - elapsed_seconds: float, + project_connection_id: str, ) -> None: ... @overload @@ -11610,33 +11808,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OptimizationJobResult(_Model): - """Terminal-state result body. Populated when status is succeeded or failed. +class OpenApiTool(Tool, discriminator="openapi"): + """The input definition information for an OpenAPI tool as used to configure an agent. - :ivar baseline: Candidate ID of the original (un-optimized) baseline evaluation. - :vartype baseline: str - :ivar best: Candidate ID of the highest-scoring candidate found during optimization. - :vartype best: str - :ivar candidates: All evaluated candidates including baseline. - :vartype candidates: list[~azure.ai.projects.models.OptimizationCandidate] + :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 """ - baseline: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Candidate ID of the original (un-optimized) baseline evaluation.""" - best: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Candidate ID of the highest-scoring candidate found during optimization.""" - candidates: Optional[list["_models.OptimizationCandidate"]] = rest_field( + 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"] ) - """All evaluated candidates including baseline.""" + """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, *, - baseline: Optional[str] = None, - best: Optional[str] = None, - candidates: Optional[list["_models.OptimizationCandidate"]] = None, + openapi: "_models.OpenApiFunctionDefinition", + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -11648,73 +11848,41 @@ 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 -class OptimizationOptions(_Model): - """Tuning knobs and run-mode for an optimization job. +class OpenApiToolboxTool(ToolboxTool, discriminator="openapi"): + """An OpenAPI tool stored in a toolbox. - :ivar max_candidates: Maximum number of optimization candidates to generate. Must be >= 1. - Default: 5. - :vartype max_candidates: int - :ivar optimization_config: Per-target-attribute configuration overrides. Contains skills, - tools, system_prompt for the agent, plus model space for model optimization. - :vartype optimization_config: dict[str, any] - :ivar eval_model: Model deployment used for evaluation. Defaults to server config (typically - 'gpt-4o'). - :vartype eval_model: str - :ivar optimization_model: Model deployment for optimization reasoning (must be gpt-5 family). - Falls back to the default eval model when not set. - :vartype optimization_model: str - :ivar evaluation_level: Evaluation granularity. Null/omitted means per-item single-turn. Set to - 'conversation' for per-conversation multi-turn simulation scoring. Known values are: "turn" and - "conversation". - :vartype evaluation_level: str or ~azure.ai.projects.models.EvaluationLevel - :ivar max_stalls: Maximum number of consecutive reflective minibatch rejections before stopping - early. A 'stall' occurs when the optimizer proposes a prompt change, evaluates it on a small - subset, and the score does not improve — so no full validation-set evaluation is triggered. The - counter resets whenever a minibatch passes and its full-validation score beats the current - best. Only a sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the - stop. The service defaults to 5 if a value is not specified by the caller. Must be >= 1 when - set. - :vartype max_stalls: int + :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. OPENAPI. + :vartype type: str or ~azure.ai.projects.models.OPENAPI + :ivar openapi: The openapi function definition. Required. + :vartype openapi: ~azure.ai.projects.models.OpenApiFunctionDefinition """ - max_candidates: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of optimization candidates to generate. Must be >= 1. Default: 5.""" - optimization_config: Optional[dict[str, Any]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Per-target-attribute configuration overrides. Contains skills, tools, system_prompt for the - agent, plus model space for model optimization.""" - eval_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Model deployment used for evaluation. Defaults to server config (typically 'gpt-4o').""" - optimization_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Model deployment for optimization reasoning (must be gpt-5 family). Falls back to the default - eval model when not set.""" - evaluation_level: Optional[Union[str, "_models.EvaluationLevel"]] = rest_field( + 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"] ) - """Evaluation granularity. Null/omitted means per-item single-turn. Set to 'conversation' for - per-conversation multi-turn simulation scoring. Known values are: \"turn\" and - \"conversation\".""" - max_stalls: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of consecutive reflective minibatch rejections before stopping early. A 'stall' - occurs when the optimizer proposes a prompt change, evaluates it on a small subset, and the - score does not improve — so no full validation-set evaluation is triggered. The counter resets - whenever a minibatch passes and its full-validation score beats the current best. Only a - sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the stop. The - service defaults to 5 if a value is not specified by the caller. Must be >= 1 when set.""" + """The openapi function definition. Required.""" @overload def __init__( self, *, - max_candidates: Optional[int] = None, - optimization_config: Optional[dict[str, Any]] = None, - eval_model: Optional[str] = None, - optimization_model: Optional[str] = None, - evaluation_level: Optional[Union[str, "_models.EvaluationLevel"]] = None, - max_stalls: Optional[int] = None, + openapi: "_models.OpenApiFunctionDefinition", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -11726,34 +11894,30 @@ 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 OptimizationReferenceDatasetInput(OptimizationDatasetInput, discriminator="reference"): - """Reference to a registered Foundry dataset. +class OptimizedAgentIdentifier(_Model): + """Identifies the registered Foundry agent to optimize (request-only). Skills, tools, and + system_prompt are specified in options.optimization_config. - :ivar type: Dataset input type discriminator. Required. Reference to a registered Foundry - dataset by name and version. - :vartype type: str or ~azure.ai.projects.models.REFERENCE - :ivar name: Registered dataset name. Required. - :vartype name: str - :ivar version: Dataset version. If not specified, the latest version is used. - :vartype version: str + :ivar agent_name: Registered Foundry agent name (required). Required. + :vartype agent_name: str + :ivar agent_version: Pinned agent version. Defaults to latest if omitted. + :vartype agent_version: str """ - type: Literal[OptimizationDatasetInputType.REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Dataset input type discriminator. Required. Reference to a registered Foundry dataset by name - and version.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Registered dataset name. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset version. If not specified, the latest version is used.""" + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Registered Foundry agent name (required). Required.""" + agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Pinned agent version. Defaults to latest if omitted.""" @overload def __init__( self, *, - name: str, - version: Optional[str] = None, + agent_name: str, + agent_version: Optional[str] = None, ) -> None: ... @overload @@ -11765,7 +11929,6 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OptimizationDatasetInputType.REFERENCE # type: ignore class TelemetryEndpoint(_Model): @@ -13604,6 +13767,48 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobType.SIMPLE_QNA # type: ignore +class SimulationSeedDataGenerationJobOptions(DataGenerationJobOptions, discriminator="simulation_seed"): + """The options for a simulation seed 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 max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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, + *, + max_samples: int, + 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 SkillDetails(_Model): """A skill resource. @@ -13997,48 +14202,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TaskGenerationDataGenerationJobOptions(DataGenerationJobOptions, discriminator="task_generation"): - """The options 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 max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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 TaskGeneration for this model. Required. - Task generation for evaluation scenarios. - :vartype type: str or ~azure.ai.projects.models.TASK_GENERATION - """ - - type: Literal[DataGenerationJobType.TASK_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The data generation job type, which is TaskGeneration for this model. Required. Task generation - for evaluation scenarios.""" - - @overload - def __init__( - self, - *, - max_samples: int, - 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.TASK_GENERATION # type: ignore - - class TaxonomyCategory(_Model): """Taxonomy category definition. @@ -15257,11 +15420,17 @@ class TracesDataGenerationJobOptions(DataGenerationJobOptions, discriminator="tr :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 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[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.""" + 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__( @@ -15270,6 +15439,7 @@ def __init__( max_samples: int, train_split: Optional[float] = None, model_options: Optional["_models.DataGenerationModelOptions"] = None, + redact_private_content: Optional[bool] = None, ) -> None: ... @overload @@ -15979,7 +16149,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class WorkflowAgentDefinition(AgentDefinition, discriminator="workflow"): - """The workflow agent definition. + """The workflow agent definition. Microsoft Foundry is retiring workflows on December 1, 2026. If + you're looking to build new workflows, use Microsoft Agent Framework. To migrate existing + workflows, see the `Migration guide + `_. :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. :vartype rai_config: ~azure.ai.projects.models.RaiConfig diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py index 257e53dded78..81717c62e046 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py @@ -33,7 +33,13 @@ TracesPreviewEvalRunDataSource, ) from ._models import CustomCredential as CustomCredentialGenerated -from ..models import MemoryStoreUpdateCompletedResult, MemoryStoreUpdateResult +from ..models import ( + AgentOptimizationJobResult, + DataGenerationJobResult, + EvaluatorVersion, + MemoryStoreUpdateCompletedResult, + MemoryStoreUpdateResult, +) from ._enums import _FoundryFeaturesOptInKeys, _AgentDefinitionOptInKeys _FOUNDRY_FEATURES_HEADER_NAME: Final[str] = "Foundry-Features" @@ -61,7 +67,7 @@ "memory_stores": _FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW.value, "models": _FoundryFeaturesOptInKeys.MODELS_V1_PREVIEW.value, "red_teams": _FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW.value, - "routines": _FoundryFeaturesOptInKeys.ROUTINES_V1_PREVIEW.value, + "routines": _FoundryFeaturesOptInKeys.ROUTINES_V2_PREVIEW.value, "schedules": _FoundryFeaturesOptInKeys.SCHEDULES_V1_PREVIEW.value, "skills": _FoundryFeaturesOptInKeys.SKILLS_V1_PREVIEW.value, "datasets": _FoundryFeaturesOptInKeys.DATA_GENERATION_JOBS_V1_PREVIEW.value, @@ -380,7 +386,249 @@ def from_continuation_token( return cls(client, initial_response, deserialization_callback, polling_method) +class DatasetGenerationLROPoller(LROPoller[DataGenerationJobResult]): + """Custom LROPoller for data generation job operations.""" + + def __init__(self, client: Any, initial_response: Any, deserialization_callback: Any, polling_method: Any) -> None: + self._job_id = self._get_job_id(initial_response) + super().__init__(client, initial_response, deserialization_callback, polling_method) + + @staticmethod + def _get_job_id(initial_response: Any) -> Optional[str]: + try: + return initial_response.http_response.json().get("id") + except (AttributeError, TypeError, ValueError): + return None + + @property + def details(self) -> Mapping[str, Any]: + """Returns metadata associated with the data generation job operation. + + The mapping contains a ``job_id`` key whose value is the created data generation job ID. + + :return: A mapping containing the ``job_id`` key. + :rtype: Mapping[str, Any] + """ + return {"job_id": self._job_id} + + @classmethod + def from_continuation_token( + cls, polling_method: PollingMethod[DataGenerationJobResult], continuation_token: str, **kwargs: Any + ) -> "DatasetGenerationLROPoller": + """Create a poller from a continuation token. + + :param polling_method: The polling strategy to adopt. + :type polling_method: ~azure.core.polling.PollingMethod + :param continuation_token: An opaque continuation token. + :type continuation_token: str + :return: An instance of DatasetGenerationLROPoller. + :rtype: DatasetGenerationLROPoller + """ + client, initial_response, deserialization_callback = polling_method.from_continuation_token( + continuation_token, **kwargs + ) + return cls(client, initial_response, deserialization_callback, polling_method) + + +class AsyncDatasetGenerationLROPoller(AsyncLROPoller[DataGenerationJobResult]): + """Custom AsyncLROPoller for data generation job operations.""" + + def __init__(self, client: Any, initial_response: Any, deserialization_callback: Any, polling_method: Any) -> None: + super().__init__(client, initial_response, deserialization_callback, polling_method) + self._job_id = DatasetGenerationLROPoller._get_job_id(initial_response) + + @property + def details(self) -> Mapping[str, Any]: + """Returns metadata associated with the data generation job operation. + + The mapping contains a ``job_id`` key whose value is the created data generation job ID. + + :return: A mapping containing the ``job_id`` key. + :rtype: Mapping[str, Any] + """ + return {"job_id": self._job_id} + + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[DataGenerationJobResult], + continuation_token: str, + **kwargs: Any, + ) -> "AsyncDatasetGenerationLROPoller": + """Create a poller from a continuation token. + + :param polling_method: The polling strategy to adopt. + :type polling_method: ~azure.core.polling.AsyncPollingMethod + :param continuation_token: An opaque continuation token. + :type continuation_token: str + :return: An instance of AsyncDatasetGenerationLROPoller. + :rtype: AsyncDatasetGenerationLROPoller + """ + client, initial_response, deserialization_callback = polling_method.from_continuation_token( + continuation_token, **kwargs + ) + return cls(client, initial_response, deserialization_callback, polling_method) + + +class EvaluatorGenerationLROPoller(LROPoller[EvaluatorVersion]): + """Custom LROPoller for evaluator generation job operations.""" + + def __init__(self, client: Any, initial_response: Any, deserialization_callback: Any, polling_method: Any) -> None: + self._job_id = DatasetGenerationLROPoller._get_job_id(initial_response) + super().__init__(client, initial_response, deserialization_callback, polling_method) + + @property + def details(self) -> Mapping[str, Any]: + """Returns metadata associated with the evaluator generation job operation. + + The mapping contains a ``job_id`` key whose value is the created evaluator generation job ID. + + :return: A mapping containing the ``job_id`` key. + :rtype: Mapping[str, Any] + """ + return {"job_id": self._job_id} + + @classmethod + def from_continuation_token( + cls, polling_method: PollingMethod[EvaluatorVersion], continuation_token: str, **kwargs: Any + ) -> "EvaluatorGenerationLROPoller": + """Create a poller from a continuation token. + + :param polling_method: The polling strategy to adopt. + :type polling_method: ~azure.core.polling.PollingMethod + :param continuation_token: An opaque continuation token. + :type continuation_token: str + :return: An instance of EvaluatorGenerationLROPoller. + :rtype: EvaluatorGenerationLROPoller + """ + client, initial_response, deserialization_callback = polling_method.from_continuation_token( + continuation_token, **kwargs + ) + return cls(client, initial_response, deserialization_callback, polling_method) + + +class AsyncEvaluatorGenerationLROPoller(AsyncLROPoller[EvaluatorVersion]): + """Custom AsyncLROPoller for evaluator generation job operations.""" + + def __init__(self, client: Any, initial_response: Any, deserialization_callback: Any, polling_method: Any) -> None: + super().__init__(client, initial_response, deserialization_callback, polling_method) + self._job_id = DatasetGenerationLROPoller._get_job_id(initial_response) + + @property + def details(self) -> Mapping[str, Any]: + """Returns metadata associated with the evaluator generation job operation. + + The mapping contains a ``job_id`` key whose value is the created evaluator generation job ID. + + :return: A mapping containing the ``job_id`` key. + :rtype: Mapping[str, Any] + """ + return {"job_id": self._job_id} + + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[EvaluatorVersion], + continuation_token: str, + **kwargs: Any, + ) -> "AsyncEvaluatorGenerationLROPoller": + """Create a poller from a continuation token. + + :param polling_method: The polling strategy to adopt. + :type polling_method: ~azure.core.polling.AsyncPollingMethod + :param continuation_token: An opaque continuation token. + :type continuation_token: str + :return: An instance of AsyncEvaluatorGenerationLROPoller. + :rtype: AsyncEvaluatorGenerationLROPoller + """ + client, initial_response, deserialization_callback = polling_method.from_continuation_token( + continuation_token, **kwargs + ) + return cls(client, initial_response, deserialization_callback, polling_method) + + +class AgentOptimizationLROPoller(LROPoller[AgentOptimizationJobResult]): + """Custom LROPoller for agent optimization job operations.""" + + def __init__(self, client: Any, initial_response: Any, deserialization_callback: Any, polling_method: Any) -> None: + self._job_id = DatasetGenerationLROPoller._get_job_id(initial_response) + super().__init__(client, initial_response, deserialization_callback, polling_method) + + @property + def details(self) -> Mapping[str, Any]: + """Returns metadata associated with the agent optimization job operation. + + The mapping contains a ``job_id`` key whose value is the created agent optimization job ID. + + :return: A mapping containing the ``job_id`` key. + :rtype: Mapping[str, Any] + """ + return {"job_id": self._job_id} + + @classmethod + def from_continuation_token( + cls, polling_method: PollingMethod[AgentOptimizationJobResult], continuation_token: str, **kwargs: Any + ) -> "AgentOptimizationLROPoller": + """Create a poller from a continuation token. + + :param polling_method: The polling strategy to adopt. + :type polling_method: ~azure.core.polling.PollingMethod + :param continuation_token: An opaque continuation token. + :type continuation_token: str + :return: An instance of AgentOptimizationLROPoller. + :rtype: AgentOptimizationLROPoller + """ + client, initial_response, deserialization_callback = polling_method.from_continuation_token( + continuation_token, **kwargs + ) + return cls(client, initial_response, deserialization_callback, polling_method) + + +class AsyncAgentOptimizationLROPoller(AsyncLROPoller[AgentOptimizationJobResult]): + """Custom AsyncLROPoller for agent optimization job operations.""" + + def __init__(self, client: Any, initial_response: Any, deserialization_callback: Any, polling_method: Any) -> None: + super().__init__(client, initial_response, deserialization_callback, polling_method) + self._job_id = DatasetGenerationLROPoller._get_job_id(initial_response) + + @property + def details(self) -> Mapping[str, Any]: + """Returns metadata associated with the agent optimization job operation. + + The mapping contains a ``job_id`` key whose value is the created agent optimization job ID. + + :return: A mapping containing the ``job_id`` key. + :rtype: Mapping[str, Any] + """ + return {"job_id": self._job_id} + + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[AgentOptimizationJobResult], + continuation_token: str, + **kwargs: Any, + ) -> "AsyncAgentOptimizationLROPoller": + """Create a poller from a continuation token. + + :param polling_method: The polling strategy to adopt. + :type polling_method: ~azure.core.polling.AsyncPollingMethod + :param continuation_token: An opaque continuation token. + :type continuation_token: str + :return: An instance of AsyncAgentOptimizationLROPoller. + :rtype: AsyncAgentOptimizationLROPoller + """ + client, initial_response, deserialization_callback = polling_method.from_continuation_token( + continuation_token, **kwargs + ) + return cls(client, initial_response, deserialization_callback, polling_method) + + __all__: List[str] = [ + "AgentOptimizationLROPoller", + "AsyncAgentOptimizationLROPoller", + "AsyncDatasetGenerationLROPoller", + "AsyncEvaluatorGenerationLROPoller", "AsyncUpdateMemoriesLROPoller", "AzureAIAgentTargetParam", "AzureAIBenchmarkPreviewEvalRunDataSource", @@ -388,6 +636,8 @@ def from_continuation_token( "AzureAIModelTargetParam", "AzureAIResponsesEvalRunDataSource", "CustomCredential", + "DatasetGenerationLROPoller", + "EvaluatorGenerationLROPoller", "EvalCsvFileIdSource", "EvalCsvRunDataSource", "TestingCriterionAzureAIEvaluator", 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 7013e5925454..4a814bdee494 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 @@ -2757,8 +2757,7 @@ def build_beta_routines_list_request( *, limit: Optional[int] = None, after: Optional[str] = None, - before: Optional[str] = None, - order: Optional[str] = None, + order: Optional[Union[str, _models.PageOrder]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2775,8 +2774,6 @@ def build_beta_routines_list_request( _params["limit"] = _SERIALIZER.query("limit", limit, "int") if after is not None: _params["after"] = _SERIALIZER.query("after", after, "str") - if before is not None: - _params["before"] = _SERIALIZER.query("before", before, "str") if order is not None: _params["order"] = _SERIALIZER.query("order", order, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2811,8 +2808,7 @@ def build_beta_routines_list_runs_request( filter: Optional[str] = None, limit: Optional[int] = None, after: Optional[str] = None, - before: Optional[str] = None, - order: Optional[str] = None, + order: Optional[Union[str, _models.PageOrder]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2836,8 +2832,6 @@ def build_beta_routines_list_runs_request( _params["limit"] = _SERIALIZER.query("limit", limit, "int") if after is not None: _params["after"] = _SERIALIZER.query("after", after, "str") - if before is not None: - _params["before"] = _SERIALIZER.query("before", before, "str") if order is not None: _params["order"] = _SERIALIZER.query("order", order, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -14660,7 +14654,12 @@ def disable(self, routine_name: str, **kwargs: Any) -> _models.Routine: @distributed_trace def list( - self, *, limit: Optional[int] = None, before: Optional[str] = None, order: Optional[str] = None, **kwargs: Any + self, + *, + limit: Optional[int] = None, + after: Optional[str] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + **kwargs: Any ) -> ItemPaged["_models.Routine"]: """List routines. @@ -14668,12 +14667,14 @@ def list( :keyword limit: The maximum number of routines to return. Default value is None. :paramtype limit: int - :keyword before: Unsupported. Reserved for future backward pagination support. Default value is - None. - :paramtype before: str - :keyword order: The ordering direction. Supported values are asc and desc. Default value is - None. - :paramtype order: str + :keyword after: An opaque continuation token identifying where to resume the list. Prefer + following the ``next_link`` returned by the previous response, which embeds this value. Default + value is None. + :paramtype after: str + :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 :return: An iterator like instance of Routine :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Routine] :raises ~azure.core.exceptions.HttpResponseError: @@ -14691,21 +14692,47 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + def prepare_request(next_link=None): + if not next_link: + + _request = build_beta_routines_list_request( + limit=limit, + after=after, + order=order, + 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) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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) - _request = build_beta_routines_list_request( - limit=limit, - after=_continuation_token, - before=before, - order=order, - 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): @@ -14716,10 +14743,10 @@ def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, iter(list_of_elem) + return deserialized.get("next_link") or None, iter(list_of_elem) - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + def get_next(next_link=None): + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -14800,8 +14827,8 @@ def list_runs( *, filter: Optional[str] = None, limit: Optional[int] = None, - before: Optional[str] = None, - order: Optional[str] = None, + after: Optional[str] = None, + order: Optional[Union[str, _models.PageOrder]] = None, **kwargs: Any ) -> ItemPaged["_models.RoutineRun"]: """List prior runs for a routine. @@ -14815,12 +14842,14 @@ def list_runs( :paramtype filter: str :keyword limit: The maximum number of runs to return. Default value is None. :paramtype limit: int - :keyword before: Unsupported. Reserved for future backward pagination support. Default value is - None. - :paramtype before: str - :keyword order: The ordering direction. Supported values are asc and desc. Default value is - None. - :paramtype order: str + :keyword after: An opaque continuation token identifying where to resume the list. Prefer + following the ``next_link`` returned by the previous response, which embeds this value. Default + value is None. + :paramtype after: str + :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 :return: An iterator like instance of RoutineRun :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RoutineRun] :raises ~azure.core.exceptions.HttpResponseError: @@ -14838,23 +14867,49 @@ def list_runs( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + def prepare_request(next_link=None): + if not next_link: + + _request = build_beta_routines_list_runs_request( + routine_name=routine_name, + filter=filter, + limit=limit, + after=after, + order=order, + 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) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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) - _request = build_beta_routines_list_runs_request( - routine_name=routine_name, - filter=filter, - limit=limit, - after=_continuation_token, - before=before, - order=order, - 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): @@ -14865,10 +14920,10 @@ def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, iter(list_of_elem) + return deserialized.get("next_link") or None, iter(list_of_elem) - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + def get_next(next_link=None): + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -17187,7 +17242,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") def _create_optimization_job_initial( - self, job: Union[_models.OptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any + self, + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -17257,35 +17316,35 @@ def _create_optimization_job_initial( @overload def begin_create_optimization_job( self, - job: _models.OptimizationJob, + job: _models.AgentOptimizationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.OptimizationJobResult]: + ) -> LROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.OptimizationJob + :type job: ~azure.ai.projects.models.AgentOptimizationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns OptimizationJobResult. The OptimizationJobResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of LROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload def begin_create_optimization_job( self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.OptimizationJobResult]: + ) -> LROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent @@ -17299,9 +17358,9 @@ def begin_create_optimization_job( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns OptimizationJobResult. The OptimizationJobResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of LROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -17313,7 +17372,7 @@ def begin_create_optimization_job( operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.OptimizationJobResult]: + ) -> LROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent @@ -17327,37 +17386,41 @@ def begin_create_optimization_job( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns OptimizationJobResult. The OptimizationJobResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of LROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def begin_create_optimization_job( - self, job: Union[_models.OptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any - ) -> LROPoller[_models.OptimizationJobResult]: + self, + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. - :param job: The job to create. Is one of the following types: OptimizationJob, JSON, IO[bytes] - Required. - :type job: ~azure.ai.projects.models.OptimizationJob or JSON or IO[bytes] + :param job: The job to create. Is one of the following types: AgentOptimizationJob, JSON, + IO[bytes] Required. + :type job: ~azure.ai.projects.models.AgentOptimizationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str - :return: An instance of LROPoller that returns OptimizationJobResult. The OptimizationJobResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of LROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OptimizationJobResult] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentOptimizationJobResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -17382,7 +17445,7 @@ def get_long_running_output(pipeline_response): ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - deserialized = _deserialize(_models.OptimizationJobResult, response.json().get("result", {})) + deserialized = _deserialize(_models.AgentOptimizationJobResult, response.json().get("result", {})) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized @@ -17400,26 +17463,26 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.OptimizationJobResult].from_continuation_token( + return LROPoller[_models.AgentOptimizationJobResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.OptimizationJobResult]( + return LROPoller[_models.AgentOptimizationJobResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace - def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: + def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOptimizationJob: """Get an agent optimization job. Retrieves an optimization job by its identifier. :param job_id: The ID of the job. Required. :type job_id: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: AgentOptimizationJob. The AgentOptimizationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentOptimizationJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -17433,7 +17496,7 @@ def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Optimizati _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentOptimizationJob] = kwargs.pop("cls", None) _request = build_beta_agents_get_optimization_job_request( job_id=job_id, @@ -17473,7 +17536,7 @@ def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Optimizati if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.OptimizationJob, response.json()) + deserialized = _deserialize(_models.AgentOptimizationJob, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -17490,7 +17553,7 @@ def list_optimization_jobs( status: Optional[Union[str, _models.JobStatus]] = None, agent_name: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.OptimizationJobListItem"]: + ) -> ItemPaged["_models.AgentOptimizationJobListItem"]: """List agent optimization jobs. Lists optimization jobs with cursor pagination and optional status or agent name filters. @@ -17514,14 +17577,14 @@ def list_optimization_jobs( :paramtype status: str or ~azure.ai.projects.models.JobStatus :keyword agent_name: Filter to jobs targeting this agent name. Default value is None. :paramtype agent_name: str - :return: An iterator like instance of OptimizationJobListItem - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.OptimizationJobListItem] + :return: An iterator like instance of AgentOptimizationJobListItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentOptimizationJobListItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.OptimizationJobListItem]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AgentOptimizationJobListItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -17553,7 +17616,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.OptimizationJobListItem], + List[_models.AgentOptimizationJobListItem], deserialized.get("data", []), ) if cls: @@ -17582,7 +17645,7 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) @distributed_trace - def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: + def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOptimizationJob: """Cancel an agent optimization job. Requests cancellation of a running or queued job and returns an error if the job is already in @@ -17590,8 +17653,8 @@ def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Optimiz :param job_id: The ID of the job to cancel. Required. :type job_id: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: AgentOptimizationJob. The AgentOptimizationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentOptimizationJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -17605,7 +17668,7 @@ def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Optimiz _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentOptimizationJob] = kwargs.pop("cls", None) _request = build_beta_agents_cancel_optimization_job_request( job_id=job_id, @@ -17642,7 +17705,7 @@ def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Optimiz if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.OptimizationJob, response.json()) + deserialized = _deserialize(_models.AgentOptimizationJob, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py index 283443056bf4..3970566daddf 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py @@ -12,18 +12,16 @@ import inspect from typing import Any, Callable, List from ..models._patch import _FOUNDRY_FEATURES_HEADER_NAME, _BETA_OPERATION_FEATURE_HEADERS, _has_header_case_insensitive -from ._patch_agents import AgentsOperations -from ._patch_datasets import DatasetsOperations +from ._patch_agents import AgentsOperations, BetaAgentsOperations +from ._patch_datasets import BetaDatasetsOperations, DatasetsOperations +from ._patch_evaluators import BetaEvaluatorsOperations from ._patch_evaluation_rules import EvaluationRulesOperations from ._patch_telemetry import TelemetryOperations from ._patch_connections import ConnectionsOperations from ._patch_memories import BetaMemoryStoresOperations from ._patch_models import BetaModelsOperations from ._operations import ( - BetaAgentsOperations, - BetaDatasetsOperations, BetaEvaluationTaxonomiesOperations, - BetaEvaluatorsOperations, BetaInsightsOperations, BetaOperations as GeneratedBetaOperations, BetaRedTeamsOperations, @@ -121,14 +119,16 @@ class BetaOperations(GeneratedBetaOperations): def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - # Replace with patched class that includes upload() + # Replace with patched class that returns EvaluatorGenerationLROPoller self.evaluators = BetaEvaluatorsOperations(self._client, self._config, self._serialize, self._deserialize) - # Replace with patched class that adds file-path overload to upload_session_file + # Replace with patched class that returns AgentOptimizationLROPoller self.agents = BetaAgentsOperations(self._client, self._config, self._serialize, self._deserialize) # Replace with patched class that includes begin_update_memories self.memory_stores = BetaMemoryStoresOperations(self._client, self._config, self._serialize, self._deserialize) # Replace with patched class that includes create (3-step upload helper) self.models = BetaModelsOperations(self._client, self._config, self._serialize, self._deserialize) + # Replace with patched class that returns DatasetGenerationLROPoller + self.datasets = BetaDatasetsOperations(self._client, self._config, self._serialize, self._deserialize) for property_name, foundry_features_value in _BETA_OPERATION_FEATURE_HEADERS.items(): setattr( diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py index d72e81cf077d..36f226417afa 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py @@ -10,11 +10,21 @@ import hashlib from io import IOBase -from typing import Union, Optional, Any, IO, overload +from typing import Union, Optional, Any, IO, cast, overload from azure.core.exceptions import HttpResponseError +from azure.core.polling import NoPolling, PollingMethod +from azure.core.polling.base_polling import LROBasePolling from azure.core.tracing.decorator import distributed_trace -from ._operations import AgentsOperations as GeneratedAgentsOperations, JSON, _Unset +from azure.core.utils import case_insensitive_dict +from ._operations import ( + AgentsOperations as GeneratedAgentsOperations, + BetaAgentsOperations as BetaAgentsOperationsGenerated, + JSON, + _Unset, +) from .. import models as _models +from .._utils.model_base import _deserialize +from ..models import AgentOptimizationLROPoller from ..models._patch import ( _FOUNDRY_FEATURES_HEADER_NAME, _has_header_case_insensitive, @@ -348,3 +358,113 @@ def create_version_from_code( new_exc.model = exc.model raise new_exc from exc raise + + +class BetaAgentsOperations(BetaAgentsOperationsGenerated): + """Custom operations for beta agent optimization jobs.""" + + @overload + def begin_create_optimization_job( + self, + job: _models.AgentOptimizationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> AgentOptimizationLROPoller: ... + + @overload + def begin_create_optimization_job( + self, + job: JSON, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> AgentOptimizationLROPoller: ... + + @overload + def begin_create_optimization_job( + self, + job: IO[bytes], + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> AgentOptimizationLROPoller: ... + + @distributed_trace + def begin_create_optimization_job( + self, + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any, + ) -> AgentOptimizationLROPoller: + """Create an agent optimization job. + + :param job: The job to create. Required. + :type job: ~azure.ai.projects.models.AgentOptimizationJob or JSON or IO[bytes] + :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the + server creates the job unconditionally. Default value is None. + :paramtype operation_id: str + :return: A poller that returns AgentOptimizationJobResult and exposes the job ID in ``details``. + :rtype: ~azure.ai.projects.models.AgentOptimizationLROPoller + :raises ~azure.core.exceptions.HttpResponseError: + """ + headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", headers.pop("Content-Type", None)) + cls = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + continuation_token: Optional[str] = kwargs.pop("continuation_token", None) + raw_result = None + if continuation_token is None: + raw_result = self._create_optimization_job_initial( + job=job, + operation_id=operation_id, + content_type=content_type, + cls=lambda x, y, z: x, + headers=headers, + params=params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.AgentOptimizationJobResult, response.json().get("result", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if continuation_token: + return AgentOptimizationLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=continuation_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + assert raw_result is not None + return AgentOptimizationLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py index bf2c0db51271..be33b5a2763d 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py @@ -11,12 +11,22 @@ import os import re import logging -from typing import Any, Tuple, Optional +from typing import Any, IO, Tuple, Optional, Union, cast, overload +from collections.abc import MutableMapping from pathlib import Path from urllib.parse import urlsplit from azure.storage.blob import ContainerClient +from azure.core.polling import NoPolling, PollingMethod +from azure.core.polling.base_polling import LROBasePolling from azure.core.tracing.decorator import distributed_trace -from ._operations import DatasetsOperations as DatasetsOperationsGenerated +from azure.core.utils import case_insensitive_dict +from ._operations import ( + BetaDatasetsOperations as BetaDatasetsOperationsGenerated, + DatasetsOperations as DatasetsOperationsGenerated, +) +from .. import models as _models +from .._utils.model_base import _deserialize +from ..models import DatasetGenerationLROPoller from ..models._models import ( FileDatasetVersion, FolderDatasetVersion, @@ -27,6 +37,118 @@ logger = logging.getLogger(__name__) +JSON = MutableMapping[str, Any] + + +class BetaDatasetsOperations(BetaDatasetsOperationsGenerated): + """Custom operations for beta data generation jobs.""" + + @overload + def begin_create_generation_job( + self, + job: _models.DataGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> DatasetGenerationLROPoller: ... + + @overload + def begin_create_generation_job( + self, + job: JSON, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> DatasetGenerationLROPoller: ... + + @overload + def begin_create_generation_job( + self, + job: IO[bytes], + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> DatasetGenerationLROPoller: ... + + @distributed_trace + def begin_create_generation_job( + self, + job: Union[_models.DataGenerationJob, JSON, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any, + ) -> DatasetGenerationLROPoller: + """Create a data generation job. + + :param job: The job to create. Required. + :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] + :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the + server creates the job unconditionally. Default value is None. + :paramtype operation_id: str + :return: A poller that returns DataGenerationJobResult and exposes the job ID in ``details``. + :rtype: ~azure.ai.projects.models.DatasetGenerationLROPoller + :raises ~azure.core.exceptions.HttpResponseError: + """ + headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", headers.pop("Content-Type", None)) + cls = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + continuation_token: Optional[str] = kwargs.pop("continuation_token", None) + raw_result = None + if continuation_token is None: + raw_result = self._create_generation_job_initial( + job=job, + operation_id=operation_id, + content_type=content_type, + cls=lambda x, y, z: x, + headers=headers, + params=params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.DataGenerationJobResult, response.json().get("result", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if continuation_token: + return DatasetGenerationLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=continuation_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + assert raw_result is not None + return DatasetGenerationLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + class DatasetsOperations(DatasetsOperationsGenerated): """ diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluators.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluators.py new file mode 100644 index 000000000000..240e6afef83c --- /dev/null +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluators.py @@ -0,0 +1,132 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Custom evaluator operations.""" + +from collections.abc import MutableMapping +from typing import Any, IO, Optional, Union, cast, overload + +from azure.core.polling import NoPolling, PollingMethod +from azure.core.polling.base_polling import LROBasePolling +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ._operations import BetaEvaluatorsOperations as BetaEvaluatorsOperationsGenerated +from .. import models as _models +from .._utils.model_base import _deserialize +from ..models import EvaluatorGenerationLROPoller + +JSON = MutableMapping[str, Any] + + +class BetaEvaluatorsOperations(BetaEvaluatorsOperationsGenerated): + """Custom operations for beta evaluator generation jobs.""" + + @overload + def begin_create_generation_job( + self, + job: _models.EvaluatorGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> EvaluatorGenerationLROPoller: ... + + @overload + def begin_create_generation_job( + self, + job: JSON, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> EvaluatorGenerationLROPoller: ... + + @overload + def begin_create_generation_job( + self, + job: IO[bytes], + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> EvaluatorGenerationLROPoller: ... + + @distributed_trace + def begin_create_generation_job( + self, + job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any, + ) -> EvaluatorGenerationLROPoller: + """Create an evaluator generation job. + + :param job: The job to create. Required. + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] + :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the + server creates the job unconditionally. Default value is None. + :paramtype operation_id: str + :return: A poller that returns EvaluatorVersion and exposes the job ID in ``details``. + :rtype: ~azure.ai.projects.models.EvaluatorGenerationLROPoller + :raises ~azure.core.exceptions.HttpResponseError: + """ + headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", headers.pop("Content-Type", None)) + cls = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + continuation_token: Optional[str] = kwargs.pop("continuation_token", None) + raw_result = None + if continuation_token is None: + raw_result = self._create_generation_job_initial( + job=job, + operation_id=operation_id, + content_type=content_type, + cls=lambda x, y, z: x, + headers=headers, + params=params, + **kwargs, + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.EvaluatorVersion, response.json().get("result", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, + LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if continuation_token: + return EvaluatorGenerationLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=continuation_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + assert raw_result is not None + return EvaluatorGenerationLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/ai/azure-ai-projects/docs/public-methods.md b/sdk/ai/azure-ai-projects/docs/public-methods.md index 66716e015430..f352c8377ff5 100644 --- a/sdk/ai/azure-ai-projects/docs/public-methods.md +++ b/sdk/ai/azure-ai-projects/docs/public-methods.md @@ -126,13 +126,13 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand ``` .beta.agents.cancel_optimization_job -.beta.agents.begin_create_optimization_job +.beta.agents.begin_create_optimization_job* .beta.agents.delete_optimization_job .beta.agents.get_optimization_job .beta.agents.list_optimization_jobs .beta.datasets.cancel_generation_job -.beta.datasets.begin_create_generation_job +.beta.datasets.begin_create_generation_job* .beta.datasets.delete_generation_job .beta.datasets.get_generation_job .beta.datasets.list_generation_jobs @@ -144,7 +144,7 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand .beta.evaluation_taxonomies.update .beta.evaluators.cancel_generation_job -.beta.evaluators.begin_create_generation_job +.beta.evaluators.begin_create_generation_job* .beta.evaluators.create_version .beta.evaluators.delete_generation_job .beta.evaluators.delete_version diff --git a/sdk/ai/azure-ai-projects/pyproject.toml b/sdk/ai/azure-ai-projects/pyproject.toml index d903f4e1001b..712cffc7993d 100644 --- a/sdk/ai/azure-ai-projects/pyproject.toml +++ b/sdk/ai/azure-ai-projects/pyproject.toml @@ -36,7 +36,7 @@ dependencies = [ "azure-core>=1.37.0", "typing-extensions>=4.11", "azure-identity>=1.15.0", - "openai>=2.8.0", + "openai>=2.8.0,<3.0.0", "azure-storage-blob>=12.15.0", ] dynamic = [ diff --git a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling.py b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling.py index ab72b614aeb9..8565549d9e4f 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling.py +++ b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling.py @@ -40,13 +40,13 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( + AgentOptimizationEvaluatorRef, + AgentOptimizationJob, + AgentOptimizationJobInputs, + AgentOptimizationOptions, + AgentOptimizationReferenceDatasetInput, JobStatus, - OptimizationAgentIdentifier as AgentIdentifier, - OptimizationEvaluatorRef as EvaluatorRef, - OptimizationJob, - OptimizationJobInputs, - OptimizationOptions, - OptimizationReferenceDatasetInput as ReferenceDatasetInput, + OptimizedAgentIdentifier, ) load_dotenv() @@ -71,23 +71,16 @@ # 1. Create an optimization job without SDK polling. # ------------------------------------------------------------------ print("Creating optimization job...") - created_jobs: list[OptimizationJob] = [] - - def raw_response_hook(response): - # Since `polling=False` is set below, it is guaranteed that `raw_response_hook` will be - # invoked once on the initial "201 Created" response, and `response` is of type `OptimizationJob`. - response.http_response.read() - created_jobs.append(OptimizationJob(response.http_response.json())) - - job = OptimizationJob( - inputs=OptimizationJobInputs( - agent=AgentIdentifier(agent_name=agent_name), - train_dataset=ReferenceDatasetInput( + + job = AgentOptimizationJob( + inputs=AgentOptimizationJobInputs( + agent=OptimizedAgentIdentifier(agent_name=agent_name), + train_dataset=AgentOptimizationReferenceDatasetInput( name=dataset_name, version=dataset_version, ), - evaluators=[EvaluatorRef(name=evaluator_name)], - options=OptimizationOptions( + evaluators=[AgentOptimizationEvaluatorRef(name=evaluator_name)], + options=AgentOptimizationOptions( max_candidates=3, eval_model=eval_model, optimization_model=optimization_model, @@ -95,14 +88,14 @@ def raw_response_hook(response): ) ) - project_client.beta.agents.begin_create_optimization_job( + poller = project_client.beta.agents.begin_create_optimization_job( job=job, polling=False, - raw_response_hook=raw_response_hook, ) - if not created_jobs: - raise RuntimeError("The create operation did not return an optimization job.") - job = created_jobs[0] + job_id = poller.details["job_id"] + if not job_id: + raise RuntimeError("The create operation did not return an optimization job ID.") + job = project_client.beta.agents.get_optimization_job(job_id=job_id) print(f"Created job: id={job.id}, status={job.status}") # ------------------------------------------------------------------ diff --git a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling_async.py b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling_async.py index 7a8599ecb48b..82630d48b769 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling_async.py @@ -40,13 +40,13 @@ from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( + AgentOptimizationEvaluatorRef, + AgentOptimizationJob, + AgentOptimizationJobInputs, + AgentOptimizationOptions, + AgentOptimizationReferenceDatasetInput, JobStatus, - OptimizationAgentIdentifier as AgentIdentifier, - OptimizationEvaluatorRef as EvaluatorRef, - OptimizationJob, - OptimizationJobInputs, - OptimizationOptions, - OptimizationReferenceDatasetInput as ReferenceDatasetInput, + OptimizedAgentIdentifier, ) load_dotenv() @@ -73,23 +73,16 @@ async def main() -> None: # 1. Create an optimization job without SDK polling. # ------------------------------------------------------------------ print("Creating optimization job...") - pipeline_responses = [] - - def raw_response_hook(response): - # The raw_response_hook is called synchronously before the generated LRO method - # awaits read() on the initial response. Capture the pipeline response object here - # and parse the body afterwards, when read() has already been awaited. - pipeline_responses.append(response) - - job = OptimizationJob( - inputs=OptimizationJobInputs( - agent=AgentIdentifier(agent_name=agent_name), - train_dataset=ReferenceDatasetInput( + + job = AgentOptimizationJob( + inputs=AgentOptimizationJobInputs( + agent=OptimizedAgentIdentifier(agent_name=agent_name), + train_dataset=AgentOptimizationReferenceDatasetInput( name=dataset_name, version=dataset_version, ), - evaluators=[EvaluatorRef(name=evaluator_name)], - options=OptimizationOptions( + evaluators=[AgentOptimizationEvaluatorRef(name=evaluator_name)], + options=AgentOptimizationOptions( max_candidates=3, eval_model=eval_model, optimization_model=optimization_model, @@ -97,16 +90,14 @@ def raw_response_hook(response): ) ) - await project_client.beta.agents.begin_create_optimization_job( + poller = await project_client.beta.agents.begin_create_optimization_job( job=job, polling=False, - raw_response_hook=raw_response_hook, ) - # Alternatively, have the SDK handle polling by removing `polling=False`, assigning the awaited call - # to a poller, and then awaiting `poller.result()`. - if not pipeline_responses: - raise RuntimeError("The create operation did not return an optimization job.") - job = OptimizationJob(pipeline_responses[0].http_response.json()) + job_id = poller.details["job_id"] + if not job_id: + raise RuntimeError("The create operation did not return an optimization job ID.") + job = await project_client.beta.agents.get_optimization_job(job_id=job_id) print(f"Created job: id={job.id}, status={job.status}") # ------------------------------------------------------------------ diff --git a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic.py b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic.py index 66f41bf1e50a..23b6f06b39f7 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic.py +++ b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic.py @@ -41,12 +41,12 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - OptimizationAgentIdentifier as AgentIdentifier, - OptimizationEvaluatorRef as EvaluatorRef, - OptimizationJob, - OptimizationJobInputs, - OptimizationOptions, - OptimizationReferenceDatasetInput as ReferenceDatasetInput, + AgentOptimizationEvaluatorRef, + AgentOptimizationJob, + AgentOptimizationJobInputs, + AgentOptimizationOptions, + AgentOptimizationReferenceDatasetInput, + OptimizedAgentIdentifier, ) load_dotenv() @@ -68,15 +68,15 @@ # ------------------------------------------------------------------ # 1. Create an optimization job and observe the SDK-managed poller. # ------------------------------------------------------------------ - job = OptimizationJob( - inputs=OptimizationJobInputs( - agent=AgentIdentifier(agent_name=agent_name), - train_dataset=ReferenceDatasetInput( + job = AgentOptimizationJob( + inputs=AgentOptimizationJobInputs( + agent=OptimizedAgentIdentifier(agent_name=agent_name), + train_dataset=AgentOptimizationReferenceDatasetInput( name=dataset_name, version=dataset_version, ), - evaluators=[EvaluatorRef(name=evaluator_name)], - options=OptimizationOptions( + evaluators=[AgentOptimizationEvaluatorRef(name=evaluator_name)], + options=AgentOptimizationOptions( max_candidates=3, eval_model=eval_model, optimization_model=optimization_model, diff --git a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic_async.py b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic_async.py index f1453ead5590..586e5722355e 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic_async.py @@ -41,12 +41,12 @@ from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( - OptimizationAgentIdentifier as AgentIdentifier, - OptimizationEvaluatorRef as EvaluatorRef, - OptimizationJob, - OptimizationJobInputs, - OptimizationOptions, - OptimizationReferenceDatasetInput as ReferenceDatasetInput, + AgentOptimizationEvaluatorRef, + AgentOptimizationJob, + AgentOptimizationJobInputs, + AgentOptimizationOptions, + AgentOptimizationReferenceDatasetInput, + OptimizedAgentIdentifier, ) load_dotenv() @@ -70,15 +70,15 @@ async def main() -> None: # ------------------------------------------------------------------ # 1. Create an optimization job and observe the SDK-managed poller. # ------------------------------------------------------------------ - job = OptimizationJob( - inputs=OptimizationJobInputs( - agent=AgentIdentifier(agent_name=agent_name), - train_dataset=ReferenceDatasetInput( + job = AgentOptimizationJob( + inputs=AgentOptimizationJobInputs( + agent=OptimizedAgentIdentifier(agent_name=agent_name), + train_dataset=AgentOptimizationReferenceDatasetInput( name=dataset_name, version=dataset_version, ), - evaluators=[EvaluatorRef(name=evaluator_name)], - options=OptimizationOptions( + evaluators=[AgentOptimizationEvaluatorRef(name=evaluator_name)], + options=AgentOptimizationOptions( max_candidates=3, eval_model=eval_model, optimization_model=optimization_model, diff --git a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_cancel.py b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_cancel.py index 9fa92921cab5..6768394dc388 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_cancel.py +++ b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_cancel.py @@ -37,12 +37,12 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - OptimizationAgentIdentifier as AgentIdentifier, - OptimizationEvaluatorRef as EvaluatorRef, - OptimizationJob, - OptimizationJobInputs, - OptimizationOptions, - OptimizationReferenceDatasetInput as ReferenceDatasetInput, + AgentOptimizationEvaluatorRef, + AgentOptimizationJob, + AgentOptimizationJobInputs, + AgentOptimizationOptions, + AgentOptimizationReferenceDatasetInput, + OptimizedAgentIdentifier, ) load_dotenv() @@ -65,15 +65,15 @@ # ------------------------------------------------------------------ # 1. Create an optimization job and retain the SDK-managed poller. # ------------------------------------------------------------------ - job = OptimizationJob( - inputs=OptimizationJobInputs( - agent=AgentIdentifier(agent_name=agent_name), - train_dataset=ReferenceDatasetInput( + job = AgentOptimizationJob( + inputs=AgentOptimizationJobInputs( + agent=OptimizedAgentIdentifier(agent_name=agent_name), + train_dataset=AgentOptimizationReferenceDatasetInput( name=dataset_name, version=dataset_version, ), - evaluators=[EvaluatorRef(name=evaluator_name)], - options=OptimizationOptions( + evaluators=[AgentOptimizationEvaluatorRef(name=evaluator_name)], + options=AgentOptimizationOptions( max_candidates=3, eval_model=eval_model, optimization_model=optimization_model, @@ -81,11 +81,11 @@ ), ) - created_jobs: list[OptimizationJob] = [] + created_jobs: list[AgentOptimizationJob] = [] def raw_response_hook(response): response.http_response.read() - created_jobs.append(OptimizationJob(response.http_response.json())) + created_jobs.append(AgentOptimizationJob(response.http_response.json())) print("Begin creating an agent optimization job.") poller = project_client.beta.agents.begin_create_optimization_job( diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_to_agent.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_to_agent.py index e7505acb3e7d..0e857979db84 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_to_agent.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_to_agent.py @@ -38,7 +38,7 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( PromptAgentDefinition, - A2APreviewTool, + A2ATool, ) load_dotenv() @@ -46,7 +46,8 @@ endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] agent_name = os.environ.get("FOUNDRY_AGENT_NAME") or "MyAgent" -tool = A2APreviewTool( +tool = A2ATool( + a2_a_version="1.0", project_connection_id=os.environ["A2A_PROJECT_CONNECTION_ID"], ) # If the connection is missing target, we need to set the A2A endpoint URL. diff --git a/sdk/ai/azure-ai-projects/samples/datasets/sample_dataset_generation_job_simpleqna_for_finetuning_with_app_polling.py b/sdk/ai/azure-ai-projects/samples/datasets/sample_dataset_generation_job_simpleqna_for_finetuning_with_app_polling.py new file mode 100644 index 000000000000..eafcddc54d89 --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/datasets/sample_dataset_generation_job_simpleqna_for_finetuning_with_app_polling.py @@ -0,0 +1,234 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + Generates supervised fine-tuning data from a Markdown reference document + uploaded as an Azure OpenAI File. The sample: + + 1. Uploads a short reference document via the Azure OpenAI Files API + (`purpose=user_data`) so it can be referenced by file id. + 2. Creates a `DataGenerationJob` (scenario=SUPERVISED_FINETUNING, + type=simple_qna) without SDK polling. + 3. Polls the job from application code until it reaches a terminal state, + then prints every generated file output. + 4. Cleans up the generated fine-tuning files and the Azure OpenAI input file. + + `simple_qna` REQUIRES `model_options` — the service uses the configured LLM + to synthesize the QnA pairs. Setting `train_split` triggers a split of + the generated samples into two Azure OpenAI output files. + +USAGE: + python sample_dataset_generation_job_simpleqna_for_finetuning_with_app_polling.py + + Before running the sample: + + pip install "azure-ai-projects>=2.5.0" azure-identity openai python-dotenv + + Set these environment variables with your own values: + 1) FOUNDRY_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found + in the overview page of your Microsoft Foundry project. + 2) FOUNDRY_MODEL_NAME - Required. The name of an Azure OpenAI model + deployment used to synthesize the QnA samples. For `simple_qna` fine-tuning, + the deployment must support the chat completions API (e.g. `gpt-4o`, `gpt-4.1`). + 3) DATASET_NAME - Optional. Name to assign to the generated output files + (used as the file name prefix). Defaults to `simpleqna-finetuning-sample`. + The service caps the rendered output name at 50 characters, so keep + custom values short — the sample appends a unique run id suffix. + 4) POLL_INTERVAL_SECONDS - Optional. Number of seconds to sleep between status + polls for the data generation job. Defaults to 10. +""" + +import io +import os +import time +import uuid +from datetime import datetime, timezone + +from dotenv import load_dotenv + +from azure.identity import DefaultAzureCredential +from azure.ai.projects import AIProjectClient +from azure.ai.projects.models import ( + DataGenerationJob, + DataGenerationJobInputs, + DataGenerationJobOutputOptions, + DataGenerationJobScenario, + DataGenerationModelOptions, + FileDataGenerationJobOutput, + FileDataGenerationJobSource, + JobStatus, + SimpleQnADataGenerationJobOptions, + SimpleQnAFineTuningQuestionType, +) + +load_dotenv() + +endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] +model_name = os.environ["FOUNDRY_MODEL_NAME"] +dataset_name = os.environ.get("DATASET_NAME", "simpleqna-finetuning-sample") +poll_interval_seconds = int(os.environ.get("POLL_INTERVAL_SECONDS", "10")) + +TERMINAL_STATUSES = {JobStatus.SUCCEEDED, JobStatus.FAILED, JobStatus.CANCELLED} + +# Unique per-run output name so repeated runs do not collide. +# Output names are capped at 50 characters by the service. +run_id = f"{datetime.now(tz=timezone.utc).strftime('%y%m%d%H%M%S')}-{uuid.uuid4().hex[:4]}" +output_name = f"{dataset_name}-{run_id}" +if len(output_name) > 50: + raise ValueError( + f"Output name `{output_name}` exceeds the 50-character service limit. " + f"Lower DATASET_NAME (currently `{dataset_name}`) so that `-` fits within 50 characters." + ) + +# Reference document the sample uploads as an Azure OpenAI file. The service +# requires the file to contain at least 1 KB of content to generate QnA from. +SEED_REFERENCE_DOCUMENT = """# Widgets and Gizmos Reference + +## Products +- Widget: blue, manufactured at Factory 7 in Acme, carbon-fiber, rated to 80 C, sold in packs of 4, 250 g each. +- Gizmo: red, manufactured at Factory 12 in Bedrock, carbon-fiber, rated to 80 C, sold individually, 1.2 kg each. +- Sprocket: green, manufactured at Factory 3 in Acme, stainless steel, rated to 200 C, sold individually, 500 g each. + +## Operations +- Factory operates weekdays 0700-1900 local time. +- Closed on public holidays, except for the annual maintenance run on December 27. +- ISO 9001 certified; audited annually by an independent third party. +- Quality control samples every 100th unit and runs full destructive testing on every 5000th unit. + +## Customer support +- Warranty claims: email support@example.com with the serial number printed on the underside of the product. +- Returns: accepted within 30 days if unopened; opened items are eligible for repair only. +- Bulk orders (50+ units): contact sales@example.com for volume pricing and an extended 90-day return window. +- Replacement parts: orderable directly from the support portal using the original order number. + +## Pricing and SLAs +- Widget pack: USD 24.99 per 4-pack; free shipping on orders over USD 75. +- Gizmo unit: USD 49.99; free shipping on orders over USD 75. +- Sprocket unit: USD 14.99; ships from regional warehouses in 1-2 business days. +- Standard support response: within one business day. Priority support response: within four hours. +""" + +with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + project_client.get_openai_client() as openai_client, +): + + # ------------------------------------------------------------------ + # 1. Upload the seed reference document as an Azure OpenAI file. + # ------------------------------------------------------------------ + seed_filename = f"widgets-gizmos-seed-{run_id}.md" + print(f"Upload the seed reference document as Azure OpenAI file `{seed_filename}`.") + seed_file = openai_client.files.create( + file=(seed_filename, io.BytesIO(SEED_REFERENCE_DOCUMENT.encode("utf-8"))), + purpose="user_data", + ) + print(f"Uploaded Azure OpenAI file (id: {seed_file.id}).") + + # Wait for the file to finish processing — the data generation service + # rejects references to files that are not yet in the `processed` state. + print("Wait for the Azure OpenAI file to be processed.", end="", flush=True) + while seed_file.status not in ("processed", "error"): + time.sleep(2) + seed_file = openai_client.files.retrieve(file_id=seed_file.id) + print(".", end="", flush=True) + print() + if seed_file.status != "processed": + raise RuntimeError(f"Azure OpenAI file `{seed_file.id}` failed to process: status=`{seed_file.status}`.") + + # ------------------------------------------------------------------ + # 2. Submit a fine-tuning data generation job without SDK polling. + # ------------------------------------------------------------------ + job = DataGenerationJob( + inputs=DataGenerationJobInputs( + name=f"simpleqna-finetuning-{run_id}", + scenario=DataGenerationJobScenario.SUPERVISED_FINETUNING, + sources=[ + FileDataGenerationJobSource( + description="Widgets & Gizmos product / operations reference (Azure OpenAI file).", + id=seed_file.id, + ), + ], + options=SimpleQnADataGenerationJobOptions( + # Service requires max_samples to be between 15 and 1000. + max_samples=15, + # `simple_qna` REQUIRES model_options. + model_options=DataGenerationModelOptions(model=model_name), + # Split generated samples 80% training / 20% validation. + train_split=0.8, + # Ask for both short-answer and long-answer questions. + question_types=[ + SimpleQnAFineTuningQuestionType.SHORT_ANSWER, + SimpleQnAFineTuningQuestionType.LONG_ANSWER, + ], + ), + output_options=DataGenerationJobOutputOptions(name=output_name), + ), + ) + + print("Create a dataset generation job without SDK polling.") + poller = project_client.beta.datasets.begin_create_generation_job( + job=job, + polling=False, + ) + job_id = poller.details["job_id"] + if not job_id: + raise RuntimeError("The create operation did not return a data generation job ID.") + job = project_client.beta.datasets.get_generation_job(job_id=job_id) + print(f"Created job: id={job.id}, status={job.status}") + + # ------------------------------------------------------------------ + # 3. Poll from application code until the job reaches a terminal state. + # ------------------------------------------------------------------ + print(f"Polling job `{job.id}` to completion...", end="", flush=True) + while job.status not in TERMINAL_STATUSES: + time.sleep(poll_interval_seconds) + job = project_client.beta.datasets.get_generation_job(job_id=job.id) + print(".", end="", flush=True) + print() + print(f"Final job status: `{job.status}`.") + + if job.status == JobStatus.FAILED: + message = job.error.message if job.error else "" + raise RuntimeError(f"Data generation job `{job.id}` failed: {message}") + if job.status == JobStatus.CANCELLED: + raise RuntimeError(f"Data generation job `{job.id}` was cancelled.") + if job.result is None: + raise RuntimeError(f"Data generation job `{job.id}` completed without a result.") + + job_result = job.result + print(f"Data generation result: {job_result}") + + # ------------------------------------------------------------------ + # 4. Inspect the generated fine-tuning file outputs. + # ------------------------------------------------------------------ + # `train_split=0.8` produces two Azure OpenAI files: a training partition + # and a validation partition. Both are emitted as FileDataGenerationJobOutput + # entries in `job_result.outputs`. + file_outputs = [output for output in (job_result.outputs or []) if isinstance(output, FileDataGenerationJobOutput)] + if not file_outputs: + raise RuntimeError("The data generation job did not produce any file outputs.") + + print(f"Generated {len(file_outputs)} fine-tuning file(s):") + for output in file_outputs: + if not output.id: + raise RuntimeError("A file output was returned without an id.") + # Resolve the Azure OpenAI file to surface its real filename and size. + file_info = openai_client.files.retrieve(file_id=output.id) + print(f" - filename=`{file_info.filename}` id=`{output.id}` bytes={file_info.bytes}") + if job_result.generated_samples is not None: + print(f"Generated samples: {job_result.generated_samples}") + + # ------------------------------------------------------------------ + # 5. Clean up. + # ------------------------------------------------------------------ + for output in file_outputs: + print(f"Delete the generated Azure OpenAI file `{output.id}`.") + openai_client.files.delete(file_id=output.id) + + print(f"Delete the Azure OpenAI input file `{seed_file.id}`.") + openai_client.files.delete(file_id=seed_file.id) diff --git a/sdk/ai/azure-ai-projects/samples/datasets/sample_dataset_generation_job_simpleqna_for_finetuning_with_app_polling_async.py b/sdk/ai/azure-ai-projects/samples/datasets/sample_dataset_generation_job_simpleqna_for_finetuning_with_app_polling_async.py new file mode 100644 index 000000000000..52af02fed04b --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/datasets/sample_dataset_generation_job_simpleqna_for_finetuning_with_app_polling_async.py @@ -0,0 +1,241 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + Generates supervised fine-tuning data from a Markdown reference document + uploaded as an Azure OpenAI File. The sample: + + 1. Uploads a short reference document via the Azure OpenAI Files API + (`purpose=user_data`) so it can be referenced by file id. + 2. Creates a `DataGenerationJob` (scenario=SUPERVISED_FINETUNING, + type=simple_qna) without SDK polling. + 3. Polls the job asynchronously from application code until it reaches a + terminal state, then prints every generated file output. + 4. Cleans up the generated fine-tuning files and the Azure OpenAI input file. + + `simple_qna` REQUIRES `model_options` — the service uses the configured LLM + to synthesize the QnA pairs. Setting `train_split` triggers a split of + the generated samples into two Azure OpenAI output files. + +USAGE: + python sample_dataset_generation_job_simpleqna_for_finetuning_with_app_polling_async.py + + Before running the sample: + + pip install "azure-ai-projects>=2.5.0" azure-identity openai python-dotenv aiohttp + + Set these environment variables with your own values: + 1) FOUNDRY_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found + in the overview page of your Microsoft Foundry project. + 2) FOUNDRY_MODEL_NAME - Required. The name of an Azure OpenAI model + deployment used to synthesize the QnA samples. For `simple_qna` fine-tuning, + the deployment must support the chat completions API (e.g. `gpt-4o`, `gpt-4.1`). + 3) DATASET_NAME - Optional. Name to assign to the generated output files + (used as the file name prefix). Defaults to `simpleqna-finetuning-sample`. + The service caps the rendered output name at 50 characters, so keep + custom values short — the sample appends a unique run id suffix. + 4) POLL_INTERVAL_SECONDS - Optional. Number of seconds to sleep between status + polls for the data generation job. Defaults to 10. +""" + +import asyncio +import os +import uuid +from datetime import datetime, timezone + +from dotenv import load_dotenv + +from azure.identity.aio import DefaultAzureCredential +from azure.ai.projects.aio import AIProjectClient +from azure.ai.projects.models import ( + DataGenerationJob, + DataGenerationJobInputs, + DataGenerationJobOutputOptions, + DataGenerationJobScenario, + DataGenerationModelOptions, + FileDataGenerationJobOutput, + FileDataGenerationJobSource, + JobStatus, + SimpleQnADataGenerationJobOptions, + SimpleQnAFineTuningQuestionType, +) + +load_dotenv() + +endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] +model_name = os.environ["FOUNDRY_MODEL_NAME"] +dataset_name = os.environ.get("DATASET_NAME", "simpleqna-finetuning-sample") +poll_interval_seconds = int(os.environ.get("POLL_INTERVAL_SECONDS", "10")) + +TERMINAL_STATUSES = {JobStatus.SUCCEEDED, JobStatus.FAILED, JobStatus.CANCELLED} + +# Unique per-run output name so repeated runs do not collide. +# Output names are capped at 50 characters by the service. +run_id = f"{datetime.now(tz=timezone.utc).strftime('%y%m%d%H%M%S')}-{uuid.uuid4().hex[:4]}" +output_name = f"{dataset_name}-{run_id}" +if len(output_name) > 50: + raise ValueError( + f"Output name `{output_name}` exceeds the 50-character service limit. " + f"Lower DATASET_NAME (currently `{dataset_name}`) so that `-` fits within 50 characters." + ) + +# Reference document the sample uploads as an Azure OpenAI file. The service +# requires the file to contain at least 1 KB of content to generate QnA from. +SEED_REFERENCE_DOCUMENT = """# Widgets and Gizmos Reference + +## Products +- Widget: blue, manufactured at Factory 7 in Acme, carbon-fiber, rated to 80 C, sold in packs of 4, 250 g each. +- Gizmo: red, manufactured at Factory 12 in Bedrock, carbon-fiber, rated to 80 C, sold individually, 1.2 kg each. +- Sprocket: green, manufactured at Factory 3 in Acme, stainless steel, rated to 200 C, sold individually, 500 g each. + +## Operations +- Factory operates weekdays 0700-1900 local time. +- Closed on public holidays, except for the annual maintenance run on December 27. +- ISO 9001 certified; audited annually by an independent third party. +- Quality control samples every 100th unit and runs full destructive testing on every 5000th unit. + +## Customer support +- Warranty claims: email support@example.com with the serial number printed on the underside of the product. +- Returns: accepted within 30 days if unopened; opened items are eligible for repair only. +- Bulk orders (50+ units): contact sales@example.com for volume pricing and an extended 90-day return window. +- Replacement parts: orderable directly from the support portal using the original order number. + +## Pricing and SLAs +- Widget pack: USD 24.99 per 4-pack; free shipping on orders over USD 75. +- Gizmo unit: USD 49.99; free shipping on orders over USD 75. +- Sprocket unit: USD 14.99; ships from regional warehouses in 1-2 business days. +- Standard support response: within one business day. Priority support response: within four hours. +""" + + +async def main() -> None: + async with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + project_client.get_openai_client() as openai_client, + ): + + # ------------------------------------------------------------------ + # 1. Upload the seed reference document as an Azure OpenAI file. + # ------------------------------------------------------------------ + seed_filename = f"widgets-gizmos-seed-{run_id}.md" + print(f"Upload the seed reference document as Azure OpenAI file `{seed_filename}`.") + seed_file = await openai_client.files.create( + file=(seed_filename, SEED_REFERENCE_DOCUMENT.encode("utf-8"), "text/markdown"), + purpose="user_data", + ) + print(f"Uploaded Azure OpenAI file (id: {seed_file.id}).") + + # Wait for the file to finish processing — the data generation service + # rejects references to files that are not yet in the `processed` state. + print("Wait for the Azure OpenAI file to be processed.", end="", flush=True) + while seed_file.status not in ("processed", "error"): + await asyncio.sleep(2) + seed_file = await openai_client.files.retrieve(file_id=seed_file.id) + print(".", end="", flush=True) + print() + if seed_file.status != "processed": + raise RuntimeError(f"Azure OpenAI file `{seed_file.id}` failed to process: status=`{seed_file.status}`.") + + # ------------------------------------------------------------------ + # 2. Submit a fine-tuning data generation job without SDK polling. + # ------------------------------------------------------------------ + job = DataGenerationJob( + inputs=DataGenerationJobInputs( + name=f"simpleqna-finetuning-{run_id}", + scenario=DataGenerationJobScenario.SUPERVISED_FINETUNING, + sources=[ + FileDataGenerationJobSource( + description="Widgets & Gizmos product / operations reference (Azure OpenAI file).", + id=seed_file.id, + ), + ], + options=SimpleQnADataGenerationJobOptions( + # Service requires max_samples to be between 15 and 1000. + max_samples=15, + # `simple_qna` REQUIRES model_options. + model_options=DataGenerationModelOptions(model=model_name), + # Split generated samples 80% training / 20% validation. + train_split=0.8, + # Ask for both short-answer and long-answer questions. + question_types=[ + SimpleQnAFineTuningQuestionType.SHORT_ANSWER, + SimpleQnAFineTuningQuestionType.LONG_ANSWER, + ], + ), + output_options=DataGenerationJobOutputOptions(name=output_name), + ), + ) + + print("Create a dataset generation job without SDK polling.") + poller = await project_client.beta.datasets.begin_create_generation_job( + job=job, + polling=False, + ) + job_id = poller.details["job_id"] + if not job_id: + raise RuntimeError("The create operation did not return a data generation job ID.") + job = await project_client.beta.datasets.get_generation_job(job_id=job_id) + print(f"Created job: id={job.id}, status={job.status}") + + # ------------------------------------------------------------------ + # 3. Poll from application code until the job reaches a terminal state. + # ------------------------------------------------------------------ + print(f"Polling job `{job.id}` to completion...", end="", flush=True) + while job.status not in TERMINAL_STATUSES: + await asyncio.sleep(poll_interval_seconds) + job = await project_client.beta.datasets.get_generation_job(job_id=job.id) + print(".", end="", flush=True) + print() + print(f"Final job status: `{job.status}`.") + + if job.status == JobStatus.FAILED: + message = job.error.message if job.error else "" + raise RuntimeError(f"Data generation job `{job.id}` failed: {message}") + if job.status == JobStatus.CANCELLED: + raise RuntimeError(f"Data generation job `{job.id}` was cancelled.") + if job.result is None: + raise RuntimeError(f"Data generation job `{job.id}` completed without a result.") + + job_result = job.result + print(f"Data generation result: {job_result}") + + # ------------------------------------------------------------------ + # 4. Inspect the generated fine-tuning file outputs. + # ------------------------------------------------------------------ + # `train_split=0.8` produces two Azure OpenAI files: a training partition + # and a validation partition. Both are emitted as FileDataGenerationJobOutput + # entries in `job_result.outputs`. + file_outputs = [ + output for output in (job_result.outputs or []) if isinstance(output, FileDataGenerationJobOutput) + ] + if not file_outputs: + raise RuntimeError("The data generation job did not produce any file outputs.") + + print(f"Generated {len(file_outputs)} fine-tuning file(s):") + for output in file_outputs: + if not output.id: + raise RuntimeError("A file output was returned without an id.") + # Resolve the Azure OpenAI file to surface its real filename and size. + file_info = await openai_client.files.retrieve(file_id=output.id) + print(f" - filename=`{file_info.filename}` id=`{output.id}` bytes={file_info.bytes}") + if job_result.generated_samples is not None: + print(f"Generated samples: {job_result.generated_samples}") + + # ------------------------------------------------------------------ + # 5. Clean up. + # ------------------------------------------------------------------ + for output in file_outputs: + print(f"Delete the generated Azure OpenAI file `{output.id}`.") + await openai_client.files.delete(file_id=output.id) + + print(f"Delete the Azure OpenAI input file `{seed_file.id}`.") + await openai_client.files.delete(file_id=seed_file.id) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_agent_optimization_poller.py b/sdk/ai/azure-ai-projects/tests/agents/test_agent_optimization_poller.py new file mode 100644 index 000000000000..41ecb7c92947 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/agents/test_agent_optimization_poller.py @@ -0,0 +1,31 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Unit tests for sync agent optimization pollers.""" + +from unittest.mock import MagicMock + +from azure.ai.projects.models import AgentOptimizationLROPoller +from azure.ai.projects.operations._patch_agents import BetaAgentsOperations + + +def test_begin_create_optimization_job_exposes_job_id(): + """The sync create operation exposes its job ID without SDK polling.""" + operation = BetaAgentsOperations.__new__(BetaAgentsOperations) + operation._client = MagicMock() # pylint: disable=protected-access + operation._config = MagicMock(polling_interval=0) # pylint: disable=protected-access + operation._serialize = MagicMock() # pylint: disable=protected-access + operation._serialize.url.return_value = "https://example.test" # pylint: disable=protected-access + operation._deserialize = MagicMock() # pylint: disable=protected-access + + initial_response = MagicMock() + initial_response.http_response.json.return_value = {"id": "optimization-job-sync"} + operation._create_optimization_job_initial = MagicMock( + return_value=initial_response + ) # pylint: disable=protected-access + + poller = operation.begin_create_optimization_job(job={}, polling=False) + + assert isinstance(poller, AgentOptimizationLROPoller) + assert poller.details["job_id"] == "optimization-job-sync" diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_agent_optimization_poller_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_agent_optimization_poller_async.py new file mode 100644 index 000000000000..cab1827f21f4 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/agents/test_agent_optimization_poller_async.py @@ -0,0 +1,35 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Unit tests for async agent optimization pollers.""" + +from unittest.mock import AsyncMock, MagicMock + +import pytest + +from azure.ai.projects.aio.operations._patch_agents_async import BetaAgentsOperations +from azure.ai.projects.models import AsyncAgentOptimizationLROPoller + + +@pytest.mark.asyncio +async def test_begin_create_optimization_job_exposes_job_id_async(): + """The async create operation exposes its job ID without SDK polling.""" + operation = BetaAgentsOperations.__new__(BetaAgentsOperations) + operation._client = MagicMock() # pylint: disable=protected-access + operation._config = MagicMock(polling_interval=0) # pylint: disable=protected-access + operation._serialize = MagicMock() # pylint: disable=protected-access + operation._serialize.url.return_value = "https://example.test" # pylint: disable=protected-access + operation._deserialize = MagicMock() # pylint: disable=protected-access + + initial_response = MagicMock() + initial_response.http_response.json.return_value = {"id": "optimization-job-async"} + initial_response.http_response.read = AsyncMock() + operation._create_optimization_job_initial = AsyncMock( + return_value=initial_response + ) # pylint: disable=protected-access + + poller = await operation.begin_create_optimization_job(job={}, polling=False) + + assert isinstance(poller, AsyncAgentOptimizationLROPoller) + assert poller.details["job_id"] == "optimization-job-async" diff --git a/sdk/ai/azure-ai-projects/tests/datasets/test_datasets.py b/sdk/ai/azure-ai-projects/tests/datasets/test_datasets.py index cf7df74c2ffe..cf68496df52f 100644 --- a/sdk/ai/azure-ai-projects/tests/datasets/test_datasets.py +++ b/sdk/ai/azure-ai-projects/tests/datasets/test_datasets.py @@ -5,12 +5,15 @@ # ------------------------------------ import os import re +from unittest.mock import MagicMock + import pytest from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, is_live, is_live_and_not_recording, add_general_regex_sanitizer from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import DatasetVersion, DatasetType +from azure.ai.projects.models import DatasetGenerationLROPoller, DatasetVersion, DatasetType from azure.ai.projects.models._enums import ConnectionType +from azure.ai.projects.operations._patch_datasets import BetaDatasetsOperations from azure.core.exceptions import HttpResponseError # Construct the paths to the data folder and data file used in this test @@ -20,6 +23,27 @@ data_file2 = os.path.join(data_folder, "data_file2.txt") +def test_begin_create_generation_job_exposes_job_id(): + """The sync create operation exposes its job ID without SDK polling.""" + operation = BetaDatasetsOperations.__new__(BetaDatasetsOperations) + operation._client = MagicMock() # pylint: disable=protected-access + operation._config = MagicMock(polling_interval=0) # pylint: disable=protected-access + operation._serialize = MagicMock() # pylint: disable=protected-access + operation._serialize.url.return_value = "https://example.test" # pylint: disable=protected-access + operation._deserialize = MagicMock() # pylint: disable=protected-access + + initial_response = MagicMock() + initial_response.http_response.json.return_value = {"id": "job-sync"} + operation._create_generation_job_initial = MagicMock( # pylint: disable=protected-access + return_value=initial_response + ) + + poller = operation.begin_create_generation_job(job={}, polling=False) + + assert isinstance(poller, DatasetGenerationLROPoller) + assert poller.details["job_id"] == "job-sync" + + @pytest.mark.skipif( not is_live_and_not_recording(), reason="Skipped when using recordings due to flakiness of recording blob storage calls", diff --git a/sdk/ai/azure-ai-projects/tests/datasets/test_datasets_async.py b/sdk/ai/azure-ai-projects/tests/datasets/test_datasets_async.py index ac2770ddb2a5..72d0b992d7b4 100644 --- a/sdk/ai/azure-ai-projects/tests/datasets/test_datasets_async.py +++ b/sdk/ai/azure-ai-projects/tests/datasets/test_datasets_async.py @@ -5,12 +5,15 @@ # ------------------------------------ import os import re +from unittest.mock import AsyncMock, MagicMock + import pytest from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import is_live, is_live_and_not_recording, add_general_regex_sanitizer from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import DatasetVersion, DatasetType +from azure.ai.projects.aio.operations._patch_datasets_async import BetaDatasetsOperations +from azure.ai.projects.models import AsyncDatasetGenerationLROPoller, DatasetVersion, DatasetType from azure.ai.projects.models._enums import ConnectionType from azure.core.exceptions import HttpResponseError @@ -21,6 +24,29 @@ data_file2 = os.path.join(data_folder, "data_file2.txt") +@pytest.mark.asyncio +async def test_begin_create_generation_job_exposes_job_id_async(): + """The async create operation exposes its job ID without SDK polling.""" + operation = BetaDatasetsOperations.__new__(BetaDatasetsOperations) + operation._client = MagicMock() # pylint: disable=protected-access + operation._config = MagicMock(polling_interval=0) # pylint: disable=protected-access + operation._serialize = MagicMock() # pylint: disable=protected-access + operation._serialize.url.return_value = "https://example.test" # pylint: disable=protected-access + operation._deserialize = MagicMock() # pylint: disable=protected-access + + initial_response = MagicMock() + initial_response.http_response.json.return_value = {"id": "job-async"} + initial_response.http_response.read = AsyncMock() + operation._create_generation_job_initial = AsyncMock( # pylint: disable=protected-access + return_value=initial_response + ) + + poller = await operation.begin_create_generation_job(job={}, polling=False) + + assert isinstance(poller, AsyncDatasetGenerationLROPoller) + assert poller.details["job_id"] == "job-async" + + @pytest.mark.skipif( not is_live_and_not_recording(), reason="Skipped when using recordings due to flakiness of recording blob storage calls", diff --git a/sdk/ai/azure-ai-projects/tests/evaluators/test_evaluators.py b/sdk/ai/azure-ai-projects/tests/evaluators/test_evaluators.py new file mode 100644 index 000000000000..33340ac9f903 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/evaluators/test_evaluators.py @@ -0,0 +1,31 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Unit tests for sync evaluator generation pollers.""" + +from unittest.mock import MagicMock + +from azure.ai.projects.models import EvaluatorGenerationLROPoller +from azure.ai.projects.operations._patch_evaluators import BetaEvaluatorsOperations + + +def test_begin_create_generation_job_exposes_job_id(): + """The sync create operation exposes its job ID without SDK polling.""" + operation = BetaEvaluatorsOperations.__new__(BetaEvaluatorsOperations) + operation._client = MagicMock() # pylint: disable=protected-access + operation._config = MagicMock(polling_interval=0) # pylint: disable=protected-access + operation._serialize = MagicMock() # pylint: disable=protected-access + operation._serialize.url.return_value = "https://example.test" # pylint: disable=protected-access + operation._deserialize = MagicMock() # pylint: disable=protected-access + + initial_response = MagicMock() + initial_response.http_response.json.return_value = {"id": "evaluator-job-sync"} + operation._create_generation_job_initial = MagicMock( # pylint: disable=protected-access + return_value=initial_response + ) + + poller = operation.begin_create_generation_job(job={}, polling=False) + + assert isinstance(poller, EvaluatorGenerationLROPoller) + assert poller.details["job_id"] == "evaluator-job-sync" diff --git a/sdk/ai/azure-ai-projects/tests/evaluators/test_evaluators_async.py b/sdk/ai/azure-ai-projects/tests/evaluators/test_evaluators_async.py new file mode 100644 index 000000000000..33c7d066ac4e --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/evaluators/test_evaluators_async.py @@ -0,0 +1,35 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Unit tests for async evaluator generation pollers.""" + +from unittest.mock import AsyncMock, MagicMock + +import pytest + +from azure.ai.projects.aio.operations._patch_evaluators_async import BetaEvaluatorsOperations +from azure.ai.projects.models import AsyncEvaluatorGenerationLROPoller + + +@pytest.mark.asyncio +async def test_begin_create_generation_job_exposes_job_id_async(): + """The async create operation exposes its job ID without SDK polling.""" + operation = BetaEvaluatorsOperations.__new__(BetaEvaluatorsOperations) + operation._client = MagicMock() # pylint: disable=protected-access + operation._config = MagicMock(polling_interval=0) # pylint: disable=protected-access + operation._serialize = MagicMock() # pylint: disable=protected-access + operation._serialize.url.return_value = "https://example.test" # pylint: disable=protected-access + operation._deserialize = MagicMock() # pylint: disable=protected-access + + initial_response = MagicMock() + initial_response.http_response.json.return_value = {"id": "evaluator-job-async"} + initial_response.http_response.read = AsyncMock() + operation._create_generation_job_initial = AsyncMock( # pylint: disable=protected-access + return_value=initial_response + ) + + poller = await operation.begin_create_generation_job(job={}, polling=False) + + assert isinstance(poller, AsyncEvaluatorGenerationLROPoller) + assert poller.details["job_id"] == "evaluator-job-async" diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py index 55e08fee6f52..d34aab6783b8 100644 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py @@ -41,7 +41,7 @@ "memory_stores": "MemoryStores=V1Preview", "models": "Models=V1Preview", "red_teams": "RedTeams=V1Preview", - "routines": "Routines=V1Preview", + "routines": "Routines=V2Preview", "schedules": "Schedules=V1Preview", "skills": "Skills=V1Preview", "datasets": "DataGenerationJobs=V1Preview", diff --git a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py index d7a9e0e886c6..1434437be595 100644 --- a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py +++ b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py @@ -48,6 +48,7 @@ class TestSamples(AzureRecordedTestCase): "sample_agent_browser_automation.py", # APITimeoutError: request timed out "sample_agent_openapi.py", # 400 2/28/2026 validation/tool_user_error; failing weather GET curl call in OpenAPI tool "sample_agent_memory_search.py", # Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema + "sample_agent_to_agent.py", # Skipped not sample should work, but not able to obtain a project endpoint that work with a2a at this moment ], ), ) @@ -203,6 +204,7 @@ def test_models_samples(self, sample_path: str, **kwargs) -> None: "sample_dataset_generation_job_traces_for_evaluation.py", # PR #47067: recording not yet available "sample_dataset_generation_job_simpleqna_with_agent_source.py", # PR #47067: recording not yet available "sample_dataset_generation_job_simpleqna_with_file_source.py", # PR #47067: recording not yet available + "sample_dataset_generation_job_simpleqna_for_finetuning_with_app_polling.py", # Need test recordings ], ), ) diff --git a/sdk/ai/azure-ai-projects/tests/samples/test_samples_async.py b/sdk/ai/azure-ai-projects/tests/samples/test_samples_async.py index 1118a144c044..32174ad270db 100644 --- a/sdk/ai/azure-ai-projects/tests/samples/test_samples_async.py +++ b/sdk/ai/azure-ai-projects/tests/samples/test_samples_async.py @@ -168,6 +168,7 @@ async def test_models_samples(self, sample_path: str, **kwargs) -> None: samples_to_skip=[ "sample_datasets_async.py", # Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema "sample_dataset_generation_job_simpleqna_for_finetuning_async.py", # Need to add recordings + "sample_dataset_generation_job_simpleqna_for_finetuning_with_app_polling_async.py", # Need test recordings ], ), ) diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved b/sdk/ai/azure-ai-projects/tsp-location.yaml similarity index 97% rename from sdk/ai/azure-ai-projects/tsp-location.yaml.saved rename to sdk/ai/azure-ai-projects/tsp-location.yaml index 91c4a5456ac9..b871680555cb 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 5f1334500df34faa63e0255a18f3072b0219cebe +commit: 2a36b196210100d62ed0b92bac6417c3f37c399a repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents