From 8f6e3ce1d0f281700eacb7b3238238066d0fd653 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 20 Feb 2026 05:47:24 -0800 Subject: [PATCH 1/3] First --- .../azure/ai/projects/models/_models.py | 13 +++++++------ .../agents/tools/sample_agent_bing_custom_search.py | 2 +- .../agents/tools/sample_agent_bing_grounding.py | 2 +- .../agents/tools/sample_agent_web_search_preview.py | 2 +- .../sample_agent_web_search_with_custom_search.py | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index ac02f7ae85e5..27b70e37ce48 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -11803,9 +11803,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class WebSearchApproximateLocation(_Model): """Web search approximate location. - :ivar type: The type of location approximation. Always ``approximate``. Default value is - "approximate". - :vartype type: str :ivar country: :vartype country: str :ivar region: @@ -11814,20 +11811,23 @@ class WebSearchApproximateLocation(_Model): :vartype city: str :ivar timezone: :vartype timezone: str + :ivar type: The type of location approximation. Always ``approximate``. Required. Default value + is "approximate". + :vartype type: str """ - type: Optional[Literal["approximate"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of location approximation. Always ``approximate``. Default value is \"approximate\".""" country: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) region: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) city: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) timezone: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal["approximate"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of location approximation. Always ``approximate``. Required. Default value is + \"approximate\".""" @overload def __init__( self, *, - type: Optional[Literal["approximate"]] = None, country: Optional[str] = None, region: Optional[str] = None, city: Optional[str] = None, @@ -11843,6 +11843,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["approximate"] = "approximate" class WebSearchConfiguration(_Model): diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_custom_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_custom_search.py index 01e6d4cab5ee..b61dc3491a17 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_custom_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_custom_search.py @@ -13,7 +13,7 @@ Customer data will flow outside the Azure compliance boundary. Learn more: https://learn.microsoft.com/azure/ai-foundry/agents/how-to/tools/bing-tools - + DESCRIPTION: This sample demonstrates how to create an AI agent with Bing Custom Search capabilities using the BingCustomSearchPreviewTool and synchronous Azure AI Projects client. The agent can search diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_grounding.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_grounding.py index 22bc226e1f3e..70edf7d0941d 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_grounding.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_grounding.py @@ -14,7 +14,7 @@ Customer data will flow outside the Azure compliance boundary. Learn more: https://learn.microsoft.com/azure/ai-foundry/agents/how-to/tools/bing-tools - + DESCRIPTION: This sample demonstrates how to create an AI agent with Bing grounding capabilities using the BingGroundingTool and synchronous Azure AI Projects client. The agent can search diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py index 1464b04a80c4..6c3da5d5537c 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py @@ -13,7 +13,7 @@ Customer data will flow outside the Azure compliance boundary. Learn more: https://learn.microsoft.com/azure/ai-foundry/agents/how-to/tools/web-search - + DESCRIPTION: This sample demonstrates how to run Prompt Agent operations using the Web Search Preview Tool and a synchronous client. diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py index fe6d843a74d9..974bc248587a 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py @@ -13,7 +13,7 @@ Customer data will flow outside the Azure compliance boundary. Learn more: https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/tools/web-search?view=foundry - + DESCRIPTION: Demonstrates Prompt Agent operations that use the Web Search Tool configured with a Bing Custom Search connection. The agent runs synchronously and From 0d09b8d91f817ad62ea0b1e1a404a465c28a1e32 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 20 Feb 2026 07:36:54 -0800 Subject: [PATCH 2/3] Fix sample --- .../samples/agents/tools/sample_agent_web_search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py index e30788633bc4..4b7f63717af2 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py @@ -55,7 +55,7 @@ ): # [START tool_declaration] tool = WebSearchTool( - user_location=WebSearchApproximateLocation(type="approximate", country="GB", city="London", region="London") + user_location=WebSearchApproximateLocation(country="GB", city="London", region="London") ) # [END tool_declaration] # Create Agent with web search tool From 46536bd62befd113709860a8145568fb24f8c11d Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 20 Feb 2026 07:42:05 -0800 Subject: [PATCH 3/3] Update README.md --- sdk/ai/azure-ai-projects/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/ai/azure-ai-projects/README.md b/sdk/ai/azure-ai-projects/README.md index 6db8890e933b..9be73fbf3c0a 100644 --- a/sdk/ai/azure-ai-projects/README.md +++ b/sdk/ai/azure-ai-projects/README.md @@ -3,7 +3,7 @@ The AI Projects client library (in preview) is part of the Microsoft Foundry SDK, and provides easy access to resources in your Microsoft Foundry Project. Use it to: -* **Create and run Agents** using methods on methods on the `.agents` client property. +* **Create and run Agents** using methods on the `.agents` client property. * **Enhance Agents with specialized tools**: * Agent Memory Search * Agent-to-Agent (A2A) @@ -319,7 +319,7 @@ Web Search tool uses Grounding with Bing, which has additional costs and terms: ```python tool = WebSearchTool( - user_location=WebSearchApproximateLocation(type="approximate", country="GB", city="London", region="London") + user_location=WebSearchApproximateLocation(country="GB", city="London", region="London") ) ```