@@ -170,7 +170,7 @@ def test_azure_ai_chat_client_init_missing_project_endpoint() -> None:
170170 agent_id = None ,
171171 project_endpoint = None , # Missing endpoint
172172 model_deployment_name = "test-model" ,
173- async_credential = AsyncMock (spec = AsyncTokenCredential ),
173+ credential = AsyncMock (spec = AsyncTokenCredential ),
174174 )
175175
176176
@@ -190,7 +190,7 @@ def test_azure_ai_chat_client_init_missing_model_deployment_for_agent_creation()
190190 agent_id = None , # No existing agent
191191 project_endpoint = "https://test.com" ,
192192 model_deployment_name = None , # Missing for agent creation
193- async_credential = AsyncMock (spec = AsyncTokenCredential ),
193+ credential = AsyncMock (spec = AsyncTokenCredential ),
194194 )
195195
196196
@@ -223,7 +223,7 @@ def test_azure_ai_chat_client_from_dict(mock_agents_client: MagicMock) -> None:
223223
224224
225225def test_azure_ai_chat_client_init_missing_credential (azure_ai_unit_test_env : dict [str , str ]) -> None :
226- """Test AzureAIAgentClient.__init__ when async_credential is missing and no agents_client provided."""
226+ """Test AzureAIAgentClient.__init__ when credential is missing and no agents_client provided."""
227227 with pytest .raises (
228228 ServiceInitializationError , match = "Azure credential is required when agents_client is not provided"
229229 ):
@@ -232,7 +232,7 @@ def test_azure_ai_chat_client_init_missing_credential(azure_ai_unit_test_env: di
232232 agent_id = "existing-agent" ,
233233 project_endpoint = azure_ai_unit_test_env ["AZURE_AI_PROJECT_ENDPOINT" ],
234234 model_deployment_name = azure_ai_unit_test_env ["AZURE_AI_MODEL_DEPLOYMENT_NAME" ],
235- async_credential = None , # Missing credential
235+ credential = None , # Missing credential
236236 )
237237
238238
@@ -246,7 +246,7 @@ def test_azure_ai_chat_client_init_validation_error(mock_azure_credential: Magic
246246 AzureAIAgentClient (
247247 project_endpoint = "https://test.com" ,
248248 model_deployment_name = "test-model" ,
249- async_credential = mock_azure_credential ,
249+ credential = mock_azure_credential ,
250250 )
251251
252252
@@ -1373,7 +1373,7 @@ def get_weather(
13731373@skip_if_azure_ai_integration_tests_disabled
13741374async def test_azure_ai_chat_client_get_response () -> None :
13751375 """Test Azure AI Chat Client response."""
1376- async with AzureAIAgentClient (async_credential = AzureCliCredential ()) as azure_ai_chat_client :
1376+ async with AzureAIAgentClient (credential = AzureCliCredential ()) as azure_ai_chat_client :
13771377 assert isinstance (azure_ai_chat_client , ChatClientProtocol )
13781378
13791379 messages : list [ChatMessage ] = []
@@ -1398,7 +1398,7 @@ async def test_azure_ai_chat_client_get_response() -> None:
13981398@skip_if_azure_ai_integration_tests_disabled
13991399async def test_azure_ai_chat_client_get_response_tools () -> None :
14001400 """Test Azure AI Chat Client response with tools."""
1401- async with AzureAIAgentClient (async_credential = AzureCliCredential ()) as azure_ai_chat_client :
1401+ async with AzureAIAgentClient (credential = AzureCliCredential ()) as azure_ai_chat_client :
14021402 assert isinstance (azure_ai_chat_client , ChatClientProtocol )
14031403
14041404 messages : list [ChatMessage ] = []
@@ -1420,7 +1420,7 @@ async def test_azure_ai_chat_client_get_response_tools() -> None:
14201420@skip_if_azure_ai_integration_tests_disabled
14211421async def test_azure_ai_chat_client_streaming () -> None :
14221422 """Test Azure AI Chat Client streaming response."""
1423- async with AzureAIAgentClient (async_credential = AzureCliCredential ()) as azure_ai_chat_client :
1423+ async with AzureAIAgentClient (credential = AzureCliCredential ()) as azure_ai_chat_client :
14241424 assert isinstance (azure_ai_chat_client , ChatClientProtocol )
14251425
14261426 messages : list [ChatMessage ] = []
@@ -1451,7 +1451,7 @@ async def test_azure_ai_chat_client_streaming() -> None:
14511451@skip_if_azure_ai_integration_tests_disabled
14521452async def test_azure_ai_chat_client_streaming_tools () -> None :
14531453 """Test Azure AI Chat Client streaming response with tools."""
1454- async with AzureAIAgentClient (async_credential = AzureCliCredential ()) as azure_ai_chat_client :
1454+ async with AzureAIAgentClient (credential = AzureCliCredential ()) as azure_ai_chat_client :
14551455 assert isinstance (azure_ai_chat_client , ChatClientProtocol )
14561456
14571457 messages : list [ChatMessage ] = []
@@ -1479,7 +1479,7 @@ async def test_azure_ai_chat_client_streaming_tools() -> None:
14791479async def test_azure_ai_chat_client_agent_basic_run () -> None :
14801480 """Test ChatAgent basic run functionality with AzureAIAgentClient."""
14811481 async with ChatAgent (
1482- chat_client = AzureAIAgentClient (async_credential = AzureCliCredential ()),
1482+ chat_client = AzureAIAgentClient (credential = AzureCliCredential ()),
14831483 ) as agent :
14841484 # Run a simple query
14851485 response = await agent .run ("Hello! Please respond with 'Hello World' exactly." )
@@ -1496,7 +1496,7 @@ async def test_azure_ai_chat_client_agent_basic_run() -> None:
14961496async def test_azure_ai_chat_client_agent_basic_run_streaming () -> None :
14971497 """Test ChatAgent basic streaming functionality with AzureAIAgentClient."""
14981498 async with ChatAgent (
1499- chat_client = AzureAIAgentClient (async_credential = AzureCliCredential ()),
1499+ chat_client = AzureAIAgentClient (credential = AzureCliCredential ()),
15001500 ) as agent :
15011501 # Run streaming query
15021502 full_message : str = ""
@@ -1516,7 +1516,7 @@ async def test_azure_ai_chat_client_agent_basic_run_streaming() -> None:
15161516async def test_azure_ai_chat_client_agent_thread_persistence () -> None :
15171517 """Test ChatAgent thread persistence across runs with AzureAIAgentClient."""
15181518 async with ChatAgent (
1519- chat_client = AzureAIAgentClient (async_credential = AzureCliCredential ()),
1519+ chat_client = AzureAIAgentClient (credential = AzureCliCredential ()),
15201520 instructions = "You are a helpful assistant with good memory." ,
15211521 ) as agent :
15221522 # Create a new thread that will be reused
@@ -1542,7 +1542,7 @@ async def test_azure_ai_chat_client_agent_thread_persistence() -> None:
15421542async def test_azure_ai_chat_client_agent_existing_thread_id () -> None :
15431543 """Test ChatAgent existing thread ID functionality with AzureAIAgentClient."""
15441544 async with ChatAgent (
1545- chat_client = AzureAIAgentClient (async_credential = AzureCliCredential ()),
1545+ chat_client = AzureAIAgentClient (credential = AzureCliCredential ()),
15461546 instructions = "You are a helpful assistant with good memory." ,
15471547 ) as first_agent :
15481548 # Start a conversation and get the thread ID
@@ -1559,7 +1559,7 @@ async def test_azure_ai_chat_client_agent_existing_thread_id() -> None:
15591559
15601560 # Now continue with the same thread ID in a new agent instance
15611561 async with ChatAgent (
1562- chat_client = AzureAIAgentClient (thread_id = existing_thread_id , async_credential = AzureCliCredential ()),
1562+ chat_client = AzureAIAgentClient (thread_id = existing_thread_id , credential = AzureCliCredential ()),
15631563 instructions = "You are a helpful assistant with good memory." ,
15641564 ) as second_agent :
15651565 # Create a thread with the existing ID
@@ -1581,7 +1581,7 @@ async def test_azure_ai_chat_client_agent_code_interpreter():
15811581 """Test ChatAgent with code interpreter through AzureAIAgentClient."""
15821582
15831583 async with ChatAgent (
1584- chat_client = AzureAIAgentClient (async_credential = AzureCliCredential ()),
1584+ chat_client = AzureAIAgentClient (credential = AzureCliCredential ()),
15851585 instructions = "You are a helpful assistant that can write and execute Python code." ,
15861586 tools = [HostedCodeInterpreterTool ()],
15871587 ) as agent :
@@ -1600,7 +1600,7 @@ async def test_azure_ai_chat_client_agent_code_interpreter():
16001600async def test_azure_ai_chat_client_agent_file_search ():
16011601 """Test ChatAgent with file search through AzureAIAgentClient."""
16021602
1603- client = AzureAIAgentClient (async_credential = AzureCliCredential ())
1603+ client = AzureAIAgentClient (credential = AzureCliCredential ())
16041604 file : FileInfo | None = None
16051605 vector_store : VectorStore | None = None
16061606
@@ -1655,7 +1655,7 @@ async def test_azure_ai_chat_client_agent_hosted_mcp_tool() -> None:
16551655 )
16561656
16571657 async with ChatAgent (
1658- chat_client = AzureAIAgentClient (async_credential = AzureCliCredential ()),
1658+ chat_client = AzureAIAgentClient (credential = AzureCliCredential ()),
16591659 instructions = "You are a helpful assistant that can help with microsoft documentation questions." ,
16601660 tools = [mcp_tool ],
16611661 ) as agent :
@@ -1682,7 +1682,7 @@ async def test_azure_ai_chat_client_agent_hosted_mcp_tool() -> None:
16821682async def test_azure_ai_chat_client_agent_level_tool_persistence ():
16831683 """Test that agent-level tools persist across multiple runs with AzureAIAgentClient."""
16841684 async with ChatAgent (
1685- chat_client = AzureAIAgentClient (async_credential = AzureCliCredential ()),
1685+ chat_client = AzureAIAgentClient (credential = AzureCliCredential ()),
16861686 instructions = "You are a helpful assistant that uses available tools." ,
16871687 tools = [get_weather ],
16881688 ) as agent :
@@ -1707,7 +1707,7 @@ async def test_azure_ai_chat_client_agent_level_tool_persistence():
17071707async def test_azure_ai_chat_client_agent_chat_options_run_level () -> None :
17081708 """Test ChatOptions parameter coverage at run level."""
17091709 async with ChatAgent (
1710- chat_client = AzureAIAgentClient (async_credential = AzureCliCredential ()),
1710+ chat_client = AzureAIAgentClient (credential = AzureCliCredential ()),
17111711 instructions = "You are a helpful assistant." ,
17121712 ) as agent :
17131713 response = await agent .run (
@@ -1737,7 +1737,7 @@ async def test_azure_ai_chat_client_agent_chat_options_run_level() -> None:
17371737async def test_azure_ai_chat_client_agent_chat_options_agent_level () -> None :
17381738 """Test ChatOptions parameter coverage agent level."""
17391739 async with ChatAgent (
1740- chat_client = AzureAIAgentClient (async_credential = AzureCliCredential ()),
1740+ chat_client = AzureAIAgentClient (credential = AzureCliCredential ()),
17411741 instructions = "You are a helpful assistant." ,
17421742 max_tokens = 100 ,
17431743 temperature = 0.7 ,
@@ -1963,7 +1963,7 @@ def test_azure_ai_chat_client_init_with_auto_created_agents_client(
19631963 agent_id = "test-agent" ,
19641964 project_endpoint = azure_ai_unit_test_env ["AZURE_AI_PROJECT_ENDPOINT" ],
19651965 model_deployment_name = azure_ai_unit_test_env ["AZURE_AI_MODEL_DEPLOYMENT_NAME" ],
1966- async_credential = mock_azure_credential ,
1966+ credential = mock_azure_credential ,
19671967 )
19681968
19691969 # Verify AgentsClient was created with correct parameters
0 commit comments