Skip to content

Commit c8979c5

Browse files
authored
Re-emit from TypeSpec to pick up fix for "type" discriminator in WebSearchApproximateLocation (#45276)
1 parent 202e428 commit c8979c5

7 files changed

Lines changed: 14 additions & 13 deletions

File tree

sdk/ai/azure-ai-projects/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
The AI Projects client library (in preview) is part of the Microsoft Foundry SDK, and provides easy access to
44
resources in your Microsoft Foundry Project. Use it to:
55

6-
* **Create and run Agents** using methods on methods on the `.agents` client property.
6+
* **Create and run Agents** using methods on the `.agents` client property.
77
* **Enhance Agents with specialized tools**:
88
* Agent Memory Search
99
* Agent-to-Agent (A2A)
@@ -319,7 +319,7 @@ Web Search tool uses Grounding with Bing, which has additional costs and terms:
319319

320320
```python
321321
tool = WebSearchTool(
322-
user_location=WebSearchApproximateLocation(type="approximate", country="GB", city="London", region="London")
322+
user_location=WebSearchApproximateLocation(country="GB", city="London", region="London")
323323
)
324324
```
325325

sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11803,9 +11803,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
1180311803
class WebSearchApproximateLocation(_Model):
1180411804
"""Web search approximate location.
1180511805
11806-
:ivar type: The type of location approximation. Always ``approximate``. Default value is
11807-
"approximate".
11808-
:vartype type: str
1180911806
:ivar country:
1181011807
:vartype country: str
1181111808
:ivar region:
@@ -11814,20 +11811,23 @@ class WebSearchApproximateLocation(_Model):
1181411811
:vartype city: str
1181511812
:ivar timezone:
1181611813
:vartype timezone: str
11814+
:ivar type: The type of location approximation. Always ``approximate``. Required. Default value
11815+
is "approximate".
11816+
:vartype type: str
1181711817
"""
1181811818

11819-
type: Optional[Literal["approximate"]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
11820-
"""The type of location approximation. Always ``approximate``. Default value is \"approximate\"."""
1182111819
country: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
1182211820
region: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
1182311821
city: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
1182411822
timezone: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
11823+
type: Literal["approximate"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
11824+
"""The type of location approximation. Always ``approximate``. Required. Default value is
11825+
\"approximate\"."""
1182511826

1182611827
@overload
1182711828
def __init__(
1182811829
self,
1182911830
*,
11830-
type: Optional[Literal["approximate"]] = None,
1183111831
country: Optional[str] = None,
1183211832
region: Optional[str] = None,
1183311833
city: Optional[str] = None,
@@ -11843,6 +11843,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None:
1184311843

1184411844
def __init__(self, *args: Any, **kwargs: Any) -> None:
1184511845
super().__init__(*args, **kwargs)
11846+
self.type: Literal["approximate"] = "approximate"
1184611847

1184711848

1184811849
class WebSearchConfiguration(_Model):

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_custom_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Customer data will flow outside the Azure compliance boundary.
1414
Learn more:
1515
https://learn.microsoft.com/azure/ai-foundry/agents/how-to/tools/bing-tools
16-
16+
1717
DESCRIPTION:
1818
This sample demonstrates how to create an AI agent with Bing Custom Search capabilities
1919
using the BingCustomSearchPreviewTool and synchronous Azure AI Projects client. The agent can search

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_grounding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
Customer data will flow outside the Azure compliance boundary.
1515
Learn more:
1616
https://learn.microsoft.com/azure/ai-foundry/agents/how-to/tools/bing-tools
17-
17+
1818
DESCRIPTION:
1919
This sample demonstrates how to create an AI agent with Bing grounding capabilities
2020
using the BingGroundingTool and synchronous Azure AI Projects client. The agent can search

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
):
5656
# [START tool_declaration]
5757
tool = WebSearchTool(
58-
user_location=WebSearchApproximateLocation(type="approximate", country="GB", city="London", region="London")
58+
user_location=WebSearchApproximateLocation(country="GB", city="London", region="London")
5959
)
6060
# [END tool_declaration]
6161
# Create Agent with web search tool

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Customer data will flow outside the Azure compliance boundary.
1414
Learn more:
1515
https://learn.microsoft.com/azure/ai-foundry/agents/how-to/tools/web-search
16-
16+
1717
DESCRIPTION:
1818
This sample demonstrates how to run Prompt Agent operations
1919
using the Web Search Preview Tool and a synchronous client.

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Customer data will flow outside the Azure compliance boundary.
1414
Learn more:
1515
https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/tools/web-search?view=foundry
16-
16+
1717
DESCRIPTION:
1818
Demonstrates Prompt Agent operations that use the Web Search Tool configured
1919
with a Bing Custom Search connection. The agent runs synchronously and

0 commit comments

Comments
 (0)