File tree Expand file tree Collapse file tree
src/backend/v4/magentic_agents/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,7 +149,10 @@ async def _after_open(self) -> None:
149149 raise NotImplementedError
150150
151151 def get_chat_client (self , chat_client ) -> AzureAIClient :
152- """Return the underlying ChatClientProtocol (AzureAIClient)."""
152+ """Return the underlying ChatClientProtocol (AzureAIClient).
153+
154+ Uses agent_name with use_latest_version=True to get the latest agent version
155+ """
153156 if chat_client :
154157 return chat_client
155158 if (
@@ -159,11 +162,14 @@ def get_chat_client(self, chat_client) -> AzureAIClient:
159162 return self ._agent .chat_client # type: ignore
160163 chat_client = AzureAIClient (
161164 project_endpoint = self .project_endpoint ,
165+ agent_name = self .agent_name ,
162166 model_deployment_name = self .model_deployment_name ,
163167 credential = self .creds ,
168+ use_latest_version = True ,
164169 )
165170 self .logger .info (
166- "Created new AzureAIClient for get chat client" ,
171+ "Created new AzureAIClient (agent_name=%s, use_latest_version=True)" ,
172+ self .agent_name ,
167173 )
168174 return chat_client
169175
You can’t perform that action at this time.
0 commit comments