@@ -79,6 +79,7 @@ def get_agent_config(
79
79
output_shields : Optional [List [str ]] = None ,
80
80
response_format : Optional [ResponseFormat ] = None ,
81
81
enable_session_persistence : Optional [bool ] = None ,
82
+ name : str | None = None ,
82
83
) -> AgentConfig :
83
84
# Create a minimal valid AgentConfig with required fields
84
85
if model is None or instructions is None :
@@ -106,6 +107,8 @@ def get_agent_config(
106
107
agent_config ["sampling_params" ] = sampling_params
107
108
if tool_config is not None :
108
109
agent_config ["tool_config" ] = tool_config
110
+ if name is not None :
111
+ agent_config ["name" ] = name
109
112
if tools is not None :
110
113
toolgroups : List [Toolgroup ] = []
111
114
for tool in tools :
@@ -139,6 +142,7 @@ def __init__(
139
142
response_format : Optional [ResponseFormat ] = None ,
140
143
enable_session_persistence : Optional [bool ] = None ,
141
144
extra_headers : Headers | None = None ,
145
+ name : str | None = None
142
146
):
143
147
"""Construct an Agent with the given parameters.
144
148
@@ -164,6 +168,7 @@ def __init__(
164
168
:param response_format: The response format for the agent.
165
169
:param enable_session_persistence: Whether to enable session persistence.
166
170
:param extra_headers: Extra headers to add to all requests sent by the agent.
171
+ :param name: Optional name for the agent, used in telemetry and identification.
167
172
"""
168
173
self .client = client
169
174
@@ -185,6 +190,7 @@ def __init__(
185
190
output_shields = output_shields ,
186
191
response_format = response_format ,
187
192
enable_session_persistence = enable_session_persistence ,
193
+ name = name ,
188
194
)
189
195
client_tools = AgentUtils .get_client_tools (tools )
190
196
@@ -389,6 +395,7 @@ def __init__(
389
395
response_format : Optional [ResponseFormat ] = None ,
390
396
enable_session_persistence : Optional [bool ] = None ,
391
397
extra_headers : Headers | None = None ,
398
+ name : str | None = None
392
399
):
393
400
"""Construct an Agent with the given parameters.
394
401
@@ -414,6 +421,7 @@ def __init__(
414
421
:param response_format: The response format for the agent.
415
422
:param enable_session_persistence: Whether to enable session persistence.
416
423
:param extra_headers: Extra headers to add to all requests sent by the agent.
424
+ :param name: Optional name for the agent, used in telemetry and identification.
417
425
"""
418
426
self .client = client
419
427
@@ -435,6 +443,7 @@ def __init__(
435
443
output_shields = output_shields ,
436
444
response_format = response_format ,
437
445
enable_session_persistence = enable_session_persistence ,
446
+ name = name ,
438
447
)
439
448
client_tools = AgentUtils .get_client_tools (tools )
440
449
0 commit comments