|
6 | 6 | from typing_extensions import Literal, Required, TypedDict |
7 | 7 |
|
8 | 8 | from .._types import SequenceNotStr |
| 9 | +from .user_location_param import UserLocationParam |
9 | 10 | from .cache_control_ephemeral_param import CacheControlEphemeralParam |
10 | 11 |
|
11 | 12 | __all__ = ["WebSearchTool20250305Param", "UserLocation"] |
12 | 13 |
|
13 | 14 |
|
14 | | -class UserLocation(TypedDict, total=False): |
15 | | - """Parameters for the user's location. |
16 | | -
|
17 | | - Used to provide more relevant search results. |
18 | | - """ |
19 | | - |
20 | | - type: Required[Literal["approximate"]] |
21 | | - |
22 | | - city: Optional[str] |
23 | | - """The city of the user.""" |
24 | | - |
25 | | - country: Optional[str] |
26 | | - """ |
27 | | - The two letter |
28 | | - [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the |
29 | | - user. |
30 | | - """ |
31 | | - |
32 | | - region: Optional[str] |
33 | | - """The region of the user.""" |
34 | | - |
35 | | - timezone: Optional[str] |
36 | | - """The [IANA timezone](https://nodatime.org/TimeZones) of the user.""" |
37 | | - |
38 | | - |
39 | 15 | class WebSearchTool20250305Param(TypedDict, total=False): |
40 | 16 | name: Required[Literal["web_search"]] |
41 | 17 | """Name of the tool. |
@@ -74,8 +50,11 @@ class WebSearchTool20250305Param(TypedDict, total=False): |
74 | 50 | strict: bool |
75 | 51 | """When true, guarantees schema validation on tool names and inputs""" |
76 | 52 |
|
77 | | - user_location: Optional[UserLocation] |
| 53 | + user_location: Optional[UserLocationParam] |
78 | 54 | """Parameters for the user's location. |
79 | 55 |
|
80 | 56 | Used to provide more relevant search results. |
81 | 57 | """ |
| 58 | + |
| 59 | + |
| 60 | +UserLocation = UserLocationParam # backward compat alias |
0 commit comments