1212from typing import Any , Literal , Mapping , Optional , TYPE_CHECKING , Union , overload
1313
1414from .._utils .model_base import Model as _Model , rest_discriminator , rest_field
15+ from .._utils .utils import FileType
1516from ._enums import (
1617 AgentBlueprintReferenceType ,
1718 AgentEndpointAuthorizationSchemeType ,
@@ -2926,6 +2927,12 @@ class CodeConfiguration(_Model):
29262927 :vartype runtime: str
29272928 :ivar entry_point: The entry point command and arguments for the code execution. Required.
29282929 :vartype entry_point: list[str]
2930+ :ivar dependency_resolution: How package dependencies are resolved at deployment time. Defaults
2931+ to ``bundled``, where the caller bundles all dependencies into the uploaded zip and the service
2932+ performs no remote build. ``remote_build`` instructs the service to build dependencies remotely
2933+ from the manifest included in the uploaded zip. Required. Known values are: "bundled" and
2934+ "remote_build".
2935+ :vartype dependency_resolution: str or ~azure.ai.projects.models.CodeDependencyResolution
29292936 :ivar content_hash: The SHA-256 hex digest of the uploaded code zip. Set by the service from
29302937 the ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in
29312938 request payloads.
@@ -2937,6 +2944,13 @@ class CodeConfiguration(_Model):
29372944 Required."""
29382945 entry_point : list [str ] = rest_field (visibility = ["read" , "create" , "update" , "delete" , "query" ])
29392946 """The entry point command and arguments for the code execution. Required."""
2947+ dependency_resolution : Union [str , "_models.CodeDependencyResolution" ] = rest_field (
2948+ visibility = ["read" , "create" , "update" , "delete" , "query" ]
2949+ )
2950+ """How package dependencies are resolved at deployment time. Defaults to ``bundled``, where the
2951+ caller bundles all dependencies into the uploaded zip and the service performs no remote build.
2952+ ``remote_build`` instructs the service to build dependencies remotely from the manifest
2953+ included in the uploaded zip. Required. Known values are: \" bundled\" and \" remote_build\" ."""
29402954 content_hash : Optional [str ] = rest_field (visibility = ["read" ])
29412955 """The SHA-256 hex digest of the uploaded code zip. Set by the service from the
29422956 ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in request
@@ -2948,6 +2962,7 @@ def __init__(
29482962 * ,
29492963 runtime : str ,
29502964 entry_point : list [str ],
2965+ dependency_resolution : Union [str , "_models.CodeDependencyResolution" ],
29512966 ) -> None : ...
29522967
29532968 @overload
@@ -3633,6 +3648,97 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
36333648 self .type = IndexType .COSMOS_DB # type: ignore
36343649
36353650
3651+ class CreateAgentVersionFromCodeContent (_Model ):
3652+ """Multipart request body for updating or versioning a code-based agent (POST /agents/{name} and
3653+ POST /agents/{name}/versions).
3654+
3655+ :ivar metadata: JSON metadata including description and hosted definition. Required.
3656+ :vartype metadata: ~azure.ai.projects.models.CreateAgentVersionFromCodeRequest
3657+ :ivar code: The code zip file (max 250 MB). Required.
3658+ :vartype code: ~azure.ai.projects._utils.utils.FileType
3659+ """
3660+
3661+ metadata : "_models.CreateAgentVersionFromCodeRequest" = rest_field (
3662+ visibility = ["read" , "create" , "update" , "delete" , "query" ]
3663+ )
3664+ """JSON metadata including description and hosted definition. Required."""
3665+ code : FileType = rest_field (
3666+ visibility = ["read" , "create" , "update" , "delete" , "query" ], is_multipart_file_input = True
3667+ )
3668+ """The code zip file (max 250 MB). Required."""
3669+
3670+ @overload
3671+ def __init__ (
3672+ self ,
3673+ * ,
3674+ metadata : "_models.CreateAgentVersionFromCodeRequest" ,
3675+ code : FileType ,
3676+ ) -> None : ...
3677+
3678+ @overload
3679+ def __init__ (self , mapping : Mapping [str , Any ]) -> None :
3680+ """
3681+ :param mapping: raw JSON to initialize the model.
3682+ :type mapping: Mapping[str, Any]
3683+ """
3684+
3685+ def __init__ (self , * args : Any , ** kwargs : Any ) -> None :
3686+ super ().__init__ (* args , ** kwargs )
3687+
3688+
3689+ class CreateAgentVersionFromCodeRequest (_Model ):
3690+ """JSON metadata for code-based agent operations (create, update, create version). The agent name
3691+ comes from the URL path parameter or the ``x-ms-agent-name`` header, so it is not included in
3692+ this model. The content hash (SHA-256 of the zip) is carried in the ``x-ms-code-zip-sha256``
3693+ header.
3694+
3695+ :ivar description: A human-readable description of the agent.
3696+ :vartype description: str
3697+ :ivar metadata: Set of 16 key-value pairs that can be attached to an object. This can be
3698+ useful for storing additional information about the object in a structured
3699+ format, and querying for objects via API or the dashboard.
3700+
3701+ Keys are strings with a maximum length of 64 characters. Values are strings
3702+ with a maximum length of 512 characters.
3703+ :vartype metadata: dict[str, str]
3704+ :ivar definition: The hosted agent definition including code_configuration (runtime,
3705+ entry_point), cpu, memory, and protocol_versions. Required.
3706+ :vartype definition: ~azure.ai.projects.models.HostedAgentDefinition
3707+ """
3708+
3709+ description : Optional [str ] = rest_field (visibility = ["read" , "create" , "update" , "delete" , "query" ])
3710+ """A human-readable description of the agent."""
3711+ metadata : Optional [dict [str , str ]] = rest_field (visibility = ["read" , "create" , "update" , "delete" , "query" ])
3712+ """Set of 16 key-value pairs that can be attached to an object. This can be
3713+ useful for storing additional information about the object in a structured
3714+ format, and querying for objects via API or the dashboard.
3715+
3716+ Keys are strings with a maximum length of 64 characters. Values are strings
3717+ with a maximum length of 512 characters."""
3718+ definition : "_models.HostedAgentDefinition" = rest_field (visibility = ["read" , "create" , "update" , "delete" , "query" ])
3719+ """The hosted agent definition including code_configuration (runtime, entry_point), cpu, memory,
3720+ and protocol_versions. Required."""
3721+
3722+ @overload
3723+ def __init__ (
3724+ self ,
3725+ * ,
3726+ definition : "_models.HostedAgentDefinition" ,
3727+ description : Optional [str ] = None ,
3728+ metadata : Optional [dict [str , str ]] = None ,
3729+ ) -> None : ...
3730+
3731+ @overload
3732+ def __init__ (self , mapping : Mapping [str , Any ]) -> None :
3733+ """
3734+ :param mapping: raw JSON to initialize the model.
3735+ :type mapping: Mapping[str, Any]
3736+ """
3737+
3738+ def __init__ (self , * args : Any , ** kwargs : Any ) -> None :
3739+ super ().__init__ (* args , ** kwargs )
3740+
3741+
36363742class Trigger (_Model ):
36373743 """Base model for Trigger of the schedule.
36383744
@@ -4073,11 +4179,11 @@ class DataGenerationJobOptions(_Model):
40734179 """Options for managing data generation jobs.
40744180
40754181 You probably want to use the sub-classes and not this class directly. Known sub-classes are:
4076- SimpleQnADataGenerationJobOptions, TaskDataGenerationJobOptions ,
4077- ToolUseFineTuningDataGenerationJobOptions, TracesDataGenerationJobOptions
4182+ SimpleQnADataGenerationJobOptions, ToolUseFineTuningDataGenerationJobOptions ,
4183+ TracesDataGenerationJobOptions
40784184
40794185 :ivar type: The data generation job type. Required. Known values are: "simple_qna", "traces",
4080- "tool_use", and "task ".
4186+ and "tool_use ".
40814187 :vartype type: str or ~azure.ai.projects.models.DataGenerationJobType
40824188 :ivar max_samples: Maximum number of samples to generate. Required.
40834189 :vartype max_samples: int
@@ -4090,8 +4196,8 @@ class DataGenerationJobOptions(_Model):
40904196
40914197 __mapping__ : dict [str , _Model ] = {}
40924198 type : str = rest_discriminator (name = "type" , visibility = ["read" , "create" , "update" , "delete" , "query" ])
4093- """The data generation job type. Required. Known values are: \" simple_qna\" , \" traces\" ,
4094- \" tool_use\" , and \" task \" ."""
4199+ """The data generation job type. Required. Known values are: \" simple_qna\" , \" traces\" , and
4200+ \" tool_use\" ."""
40954201 max_samples : int = rest_field (visibility = ["read" , "create" , "update" , "delete" , "query" ])
40964202 """Maximum number of samples to generate. Required."""
40974203 train_split : Optional [float ] = rest_field (visibility = ["read" , "create" , "update" , "delete" , "query" ])
@@ -4229,20 +4335,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
42294335class DataGenerationTokenUsage (_Model ):
42304336 """Token usage information for a data generation job.
42314337
4232- :ivar prompt_tokens: The number of prompt tokens used.
4338+ :ivar prompt_tokens: The number of prompt tokens used. Required.
42334339 :vartype prompt_tokens: int
4234- :ivar completion_tokens: The number of completion tokens generated.
4340+ :ivar completion_tokens: The number of completion tokens generated. Required.
42354341 :vartype completion_tokens: int
4236- :ivar total_tokens: Total number of tokens used.
4342+ :ivar total_tokens: Total number of tokens used. Required.
42374343 :vartype total_tokens: int
42384344 """
42394345
4240- prompt_tokens : Optional [ int ] = rest_field (visibility = ["read" ])
4241- """The number of prompt tokens used."""
4242- completion_tokens : Optional [ int ] = rest_field (visibility = ["read" ])
4243- """The number of completion tokens generated."""
4244- total_tokens : Optional [ int ] = rest_field (visibility = ["read" ])
4245- """Total number of tokens used."""
4346+ prompt_tokens : int = rest_field (visibility = ["read" ])
4347+ """The number of prompt tokens used. Required. """
4348+ completion_tokens : int = rest_field (visibility = ["read" ])
4349+ """The number of completion tokens generated. Required. """
4350+ total_tokens : int = rest_field (visibility = ["read" ])
4351+ """Total number of tokens used. Required. """
42464352
42474353
42484354class DatasetCredential (_Model ):
@@ -10571,46 +10677,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
1057110677 super ().__init__ (* args , ** kwargs )
1057210678
1057310679
10574- class TaskDataGenerationJobOptions (DataGenerationJobOptions , discriminator = "task" ):
10575- """The options for a data generation job with Task type.
10576-
10577- :ivar max_samples: Maximum number of samples to generate. Required.
10578- :vartype max_samples: int
10579- :ivar train_split: The proportion of the generated data to be used for training when the data
10580- is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1.
10581- :vartype train_split: float
10582- :ivar model_options: The LLM model options.
10583- :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions
10584- :ivar type: The data generation job type, which is Task for this model. Required. Task helps in
10585- providing a scenario description for generating multi turn conversation between user and agent.
10586- :vartype type: str or ~azure.ai.projects.models.TASK
10587- """
10588-
10589- type : Literal [DataGenerationJobType .TASK ] = rest_discriminator (name = "type" , visibility = ["read" , "create" , "update" , "delete" , "query" ]) # type: ignore
10590- """The data generation job type, which is Task for this model. Required. Task helps in providing a
10591- scenario description for generating multi turn conversation between user and agent."""
10592-
10593- @overload
10594- def __init__ (
10595- self ,
10596- * ,
10597- max_samples : int ,
10598- train_split : Optional [float ] = None ,
10599- model_options : Optional ["_models.DataGenerationModelOptions" ] = None ,
10600- ) -> None : ...
10601-
10602- @overload
10603- def __init__ (self , mapping : Mapping [str , Any ]) -> None :
10604- """
10605- :param mapping: raw JSON to initialize the model.
10606- :type mapping: Mapping[str, Any]
10607- """
10608-
10609- def __init__ (self , * args : Any , ** kwargs : Any ) -> None :
10610- super ().__init__ (* args , ** kwargs )
10611- self .type = DataGenerationJobType .TASK # type: ignore
10612-
10613-
1061410680class TaxonomyCategory (_Model ):
1061510681 """Taxonomy category definition.
1061610682
0 commit comments