diff --git a/python/packages/azure-ai/tests/test_azure_ai_agent_client.py b/python/packages/azure-ai/tests/test_azure_ai_agent_client.py index 8420da1210..cf1a0f818d 100644 --- a/python/packages/azure-ai/tests/test_azure_ai_agent_client.py +++ b/python/packages/azure-ai/tests/test_azure_ai_agent_client.py @@ -48,6 +48,7 @@ from azure.core.credentials_async import AsyncTokenCredential from azure.core.exceptions import HttpResponseError from azure.identity.aio import AzureCliCredential from pydantic import BaseModel, Field, ValidationError +from pytest import MonkeyPatch from agent_framework_azure_ai import AzureAIAgentClient, AzureAISettings @@ -1006,8 +1007,11 @@ async def test_azure_ai_chat_client_prep_tools_file_search_no_connection(mock_ai await chat_client._prep_tools([file_search_tool]) # type: ignore -async def test_azure_ai_chat_client_prep_tools_file_search_no_index_name(mock_ai_project_client: MagicMock) -> None: +async def test_azure_ai_chat_client_prep_tools_file_search_no_index_name( + mock_ai_project_client: MagicMock, monkeypatch: MonkeyPatch +) -> None: """Test _prep_tools with HostedFileSearchTool missing index_name and vector stores.""" + monkeypatch.delenv("AZURE_AI_SEARCH_INDEX_NAME", raising=False) chat_client = create_test_azure_ai_chat_client(mock_ai_project_client, agent_id="test-agent") diff --git a/python/samples/getting_started/agents/azure_ai/azure_ai_with_hosted_mcp.py b/python/samples/getting_started/agents/azure_ai/azure_ai_with_hosted_mcp.py index 720dedf38d..dde7836445 100644 --- a/python/samples/getting_started/agents/azure_ai/azure_ai_with_hosted_mcp.py +++ b/python/samples/getting_started/agents/azure_ai/azure_ai_with_hosted_mcp.py @@ -62,7 +62,7 @@ async def main() -> None: print(f"{agent.name}: {result1}\n") print("\n=======================================\n") # Second query - query2 = "What is Microsoft Semantic Kernel?" + query2 = "What is Microsoft Agent Framework?" print(f"User: {query2}") result2 = await handle_approvals_with_thread(query2, agent, thread) print(f"{agent.name}: {result2}\n") diff --git a/python/samples/getting_started/agents/azure_ai/azure_ai_with_local_mcp.py b/python/samples/getting_started/agents/azure_ai/azure_ai_with_local_mcp.py index a390abe8cc..b5fbc0053f 100644 --- a/python/samples/getting_started/agents/azure_ai/azure_ai_with_local_mcp.py +++ b/python/samples/getting_started/agents/azure_ai/azure_ai_with_local_mcp.py @@ -40,7 +40,7 @@ async def mcp_tools_on_run_level() -> None: print(f"{agent.name}: {result1}\n") print("\n=======================================\n") # Second query - query2 = "What is Microsoft Semantic Kernel?" + query2 = "What is Microsoft Agent Framework?" print(f"User: {query2}") result2 = await agent.run(query2, tools=mcp_server) print(f"{agent.name}: {result2}\n") @@ -71,7 +71,7 @@ async def mcp_tools_on_agent_level() -> None: print(f"{agent.name}: {result1}\n") print("\n=======================================\n") # Second query - query2 = "What is Microsoft Semantic Kernel?" + query2 = "What is Microsoft Agent Framework?" print(f"User: {query2}") result2 = await agent.run(query2) print(f"{agent.name}: {result2}\n") diff --git a/python/samples/getting_started/agents/azure_ai/azure_ai_with_multiple_tools.py b/python/samples/getting_started/agents/azure_ai/azure_ai_with_multiple_tools.py index 0c36a9cecd..701ed50fa8 100644 --- a/python/samples/getting_started/agents/azure_ai/azure_ai_with_multiple_tools.py +++ b/python/samples/getting_started/agents/azure_ai/azure_ai_with_multiple_tools.py @@ -79,7 +79,7 @@ async def main() -> None: print(f"{agent.name}: {result1}\n") print("\n=======================================\n") # Second query - query2 = "What is Microsoft Semantic Kernel and use a web search to see what is Reddit saying about it?" + query2 = "What is Microsoft Agent Framework and use a web search to see what is Reddit saying about it?" print(f"User: {query2}") result2 = await handle_approvals_with_thread(query2, agent, thread) print(f"{agent.name}: {result2}\n") diff --git a/python/samples/getting_started/agents/openai/openai_chat_client_with_local_mcp.py b/python/samples/getting_started/agents/openai/openai_chat_client_with_local_mcp.py index 91bbb67541..07749339ed 100644 --- a/python/samples/getting_started/agents/openai/openai_chat_client_with_local_mcp.py +++ b/python/samples/getting_started/agents/openai/openai_chat_client_with_local_mcp.py @@ -38,7 +38,7 @@ async def mcp_tools_on_run_level() -> None: print(f"{agent.name}: {result1}\n") print("\n=======================================\n") # Second query - query2 = "What is Microsoft Semantic Kernel?" + query2 = "What is Microsoft Agent Framework?" print(f"User: {query2}") result2 = await agent.run(query2, tools=mcp_server) print(f"{agent.name}: {result2}\n") @@ -66,7 +66,7 @@ async def mcp_tools_on_agent_level() -> None: print(f"{agent.name}: {result1}\n") print("\n=======================================\n") # Second query - query2 = "What is Microsoft Semantic Kernel?" + query2 = "What is Microsoft Agent Framework?" print(f"User: {query2}") result2 = await agent.run(query2) print(f"{agent.name}: {result2}\n") diff --git a/python/samples/getting_started/agents/openai/openai_responses_client_with_hosted_mcp.py b/python/samples/getting_started/agents/openai/openai_responses_client_with_hosted_mcp.py index ece454c207..e86d113b75 100644 --- a/python/samples/getting_started/agents/openai/openai_responses_client_with_hosted_mcp.py +++ b/python/samples/getting_started/agents/openai/openai_responses_client_with_hosted_mcp.py @@ -114,7 +114,7 @@ async def run_hosted_mcp_without_thread_and_specific_approval() -> None: print(f"{agent.name}: {result1}\n") print("\n=======================================\n") # Second query - query2 = "What is Microsoft Semantic Kernel?" + query2 = "What is Microsoft Agent Framework?" print(f"User: {query2}") result2 = await handle_approvals_without_thread(query2, agent) print(f"{agent.name}: {result2}\n") @@ -146,7 +146,7 @@ async def run_hosted_mcp_without_approval() -> None: print(f"{agent.name}: {result1}\n") print("\n=======================================\n") # Second query - query2 = "What is Microsoft Semantic Kernel?" + query2 = "What is Microsoft Agent Framework?" print(f"User: {query2}") result2 = await handle_approvals_without_thread(query2, agent) print(f"{agent.name}: {result2}\n") @@ -177,7 +177,7 @@ async def run_hosted_mcp_with_thread() -> None: print(f"{agent.name}: {result1}\n") print("\n=======================================\n") # Second query - query2 = "What is Microsoft Semantic Kernel?" + query2 = "What is Microsoft Agent Framework?" print(f"User: {query2}") result2 = await handle_approvals_with_thread(query2, agent, thread) print(f"{agent.name}: {result2}\n") @@ -210,7 +210,7 @@ async def run_hosted_mcp_with_thread_streaming() -> None: print("\n") print("\n=======================================\n") # Second query - query2 = "What is Microsoft Semantic Kernel?" + query2 = "What is Microsoft Agent Framework?" print(f"User: {query2}") print(f"{agent.name}: ", end="") async for update in handle_approvals_with_thread_streaming(query2, agent, thread): diff --git a/python/samples/getting_started/agents/openai/openai_responses_client_with_local_mcp.py b/python/samples/getting_started/agents/openai/openai_responses_client_with_local_mcp.py index 9560e13c7a..e2709d2159 100644 --- a/python/samples/getting_started/agents/openai/openai_responses_client_with_local_mcp.py +++ b/python/samples/getting_started/agents/openai/openai_responses_client_with_local_mcp.py @@ -43,7 +43,7 @@ async def streaming_with_mcp(show_raw_stream: bool = False) -> None: print("") print("\n=======================================\n") # Second query - query2 = "What is Microsoft Semantic Kernel?" + query2 = "What is Microsoft Agent Framework?" print(f"User: {query2}") print(f"{agent.name}: ", end="") async for chunk in agent.run_stream(query2): @@ -76,7 +76,7 @@ async def run_with_mcp() -> None: print(f"{agent.name}: {result1}\n") print("\n=======================================\n") # Second query - query2 = "What is Microsoft Semantic Kernel?" + query2 = "What is Microsoft Agent Framework?" print(f"User: {query2}") result2 = await agent.run(query2) print(f"{agent.name}: {result2}\n")