Skip to content

Commit 28d543f

Browse files
chore(api): update composite API spec
1 parent 59c43b8 commit 28d543f

12 files changed

Lines changed: 164 additions & 105 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 2098
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1697c62901bae8e6e7468a8d683915fea9594c4361cf73318ea4c37176950c3e.yml
3-
openapi_spec_hash: 7e52a69b643162118c88325bb2c6bbd7
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2ad7eca92ab5128db17d46c8d7001828b1696eef9809b5e7c89e91f60d13f5b6.yml
3+
openapi_spec_hash: eb65bf7290139d1f0344415811bccd7a
44
config_hash: e5ee85e7627f53eaa934ba6ecf47d64d

src/cloudflare/resources/aisearch/instances/instances.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ def create(
134134
]
135135
| Omit = omit,
136136
fusion_method: Literal["max", "rrf"] | Omit = omit,
137+
hybrid_search_enabled: bool | Omit = omit,
137138
index_method: instance_create_params.IndexMethod | Omit = omit,
138139
indexing_options: Optional[instance_create_params.IndexingOptions] | Omit = omit,
139140
max_num_results: int | Omit = omit,
@@ -198,6 +199,8 @@ def create(
198199
199200
Lowercase alphanumeric, hyphens, and underscores.
200201
202+
hybrid_search_enabled: Deprecated — use index_method instead.
203+
201204
index_method: Controls which storage backends are used during indexing. Defaults to
202205
vector-only.
203206
@@ -229,6 +232,7 @@ def create(
229232
"custom_metadata": custom_metadata,
230233
"embedding_model": embedding_model,
231234
"fusion_method": fusion_method,
235+
"hybrid_search_enabled": hybrid_search_enabled,
232236
"index_method": index_method,
233237
"indexing_options": indexing_options,
234238
"max_num_results": max_num_results,
@@ -723,8 +727,9 @@ def search(
723727
id: str,
724728
*,
725729
account_id: str,
726-
messages: Iterable[instance_search_params.Message],
727730
aisearch_options: instance_search_params.AISearchOptions | Omit = omit,
731+
messages: Iterable[instance_search_params.Message] | Omit = omit,
732+
query: str | Omit = omit,
728733
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
729734
# The extra values given here take precedence over values defined on the client or passed to this method.
730735
extra_headers: Headers | None = None,
@@ -739,6 +744,9 @@ def search(
739744
Args:
740745
id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
741746
747+
query: A simple text query string. Alternative to 'messages' — provide either this or
748+
'messages', not both.
749+
742750
extra_headers: Send extra headers
743751
744752
extra_query: Add additional query parameters to the request
@@ -755,8 +763,9 @@ def search(
755763
f"/accounts/{account_id}/ai-search/instances/{id}/search",
756764
body=maybe_transform(
757765
{
758-
"messages": messages,
759766
"aisearch_options": aisearch_options,
767+
"messages": messages,
768+
"query": query,
760769
},
761770
instance_search_params.InstanceSearchParams,
762771
),
@@ -900,6 +909,7 @@ async def create(
900909
]
901910
| Omit = omit,
902911
fusion_method: Literal["max", "rrf"] | Omit = omit,
912+
hybrid_search_enabled: bool | Omit = omit,
903913
index_method: instance_create_params.IndexMethod | Omit = omit,
904914
indexing_options: Optional[instance_create_params.IndexingOptions] | Omit = omit,
905915
max_num_results: int | Omit = omit,
@@ -964,6 +974,8 @@ async def create(
964974
965975
Lowercase alphanumeric, hyphens, and underscores.
966976
977+
hybrid_search_enabled: Deprecated — use index_method instead.
978+
967979
index_method: Controls which storage backends are used during indexing. Defaults to
968980
vector-only.
969981
@@ -995,6 +1007,7 @@ async def create(
9951007
"custom_metadata": custom_metadata,
9961008
"embedding_model": embedding_model,
9971009
"fusion_method": fusion_method,
1010+
"hybrid_search_enabled": hybrid_search_enabled,
9981011
"index_method": index_method,
9991012
"indexing_options": indexing_options,
10001013
"max_num_results": max_num_results,
@@ -1489,8 +1502,9 @@ async def search(
14891502
id: str,
14901503
*,
14911504
account_id: str,
1492-
messages: Iterable[instance_search_params.Message],
14931505
aisearch_options: instance_search_params.AISearchOptions | Omit = omit,
1506+
messages: Iterable[instance_search_params.Message] | Omit = omit,
1507+
query: str | Omit = omit,
14941508
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
14951509
# The extra values given here take precedence over values defined on the client or passed to this method.
14961510
extra_headers: Headers | None = None,
@@ -1505,6 +1519,9 @@ async def search(
15051519
Args:
15061520
id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
15071521
1522+
query: A simple text query string. Alternative to 'messages' — provide either this or
1523+
'messages', not both.
1524+
15081525
extra_headers: Send extra headers
15091526
15101527
extra_query: Add additional query parameters to the request
@@ -1521,8 +1538,9 @@ async def search(
15211538
f"/accounts/{account_id}/ai-search/instances/{id}/search",
15221539
body=await async_maybe_transform(
15231540
{
1524-
"messages": messages,
15251541
"aisearch_options": aisearch_options,
1542+
"messages": messages,
1543+
"query": query,
15261544
},
15271545
instance_search_params.InstanceSearchParams,
15281546
),

src/cloudflare/types/aisearch/instance_chat_completions_params.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ class AISearchOptionsRetrieval(TypedDict, total=False):
163163
164164
'and' restricts candidates to documents containing all query terms; 'or'
165165
includes any document containing at least one term, ranked by BM25 relevance.
166-
Defaults to 'and'. Legacy values 'exact_match' and 'fuzzy_match' are accepted
167-
and map to 'and' and 'or' respectively.
166+
Defaults to 'and'.
168167
"""
169168

170169
match_threshold: float

src/cloudflare/types/aisearch/instance_create_params.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"IndexMethod",
1616
"IndexingOptions",
1717
"Metadata",
18+
"MetadataSearchForAgents",
1819
"PublicEndpointParams",
1920
"PublicEndpointParamsChatCompletionsEndpoint",
2021
"PublicEndpointParamsMcp",
@@ -105,6 +106,9 @@ class InstanceCreateParams(TypedDict, total=False):
105106

106107
fusion_method: Literal["max", "rrf"]
107108

109+
hybrid_search_enabled: bool
110+
"""Deprecated — use index_method instead."""
111+
108112
index_method: IndexMethod
109113
"""Controls which storage backends are used during indexing.
110114
@@ -210,9 +214,19 @@ class IndexingOptions(TypedDict, total=False):
210214
"""
211215

212216

217+
class MetadataSearchForAgents(TypedDict, total=False):
218+
hostname: Required[str]
219+
220+
zone_id: Required[str]
221+
222+
zone_name: Required[str]
223+
224+
213225
class Metadata(TypedDict, total=False):
214226
created_from_aisearch_wizard: bool
215227

228+
search_for_agents: MetadataSearchForAgents
229+
216230
worker_domain: str
217231

218232

@@ -288,8 +302,7 @@ class RetrievalOptions(TypedDict, total=False):
288302
289303
'and' restricts candidates to documents containing all query terms; 'or'
290304
includes any document containing at least one term, ranked by BM25 relevance.
291-
Defaults to 'and'. Legacy values 'exact_match' and 'fuzzy_match' are accepted
292-
and map to 'and' and 'or' respectively.
305+
Defaults to 'and'.
293306
"""
294307

295308

src/cloudflare/types/aisearch/instance_create_response.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"IndexMethod",
1616
"IndexingOptions",
1717
"Metadata",
18+
"MetadataSearchForAgents",
1819
"PublicEndpointParams",
1920
"PublicEndpointParamsChatCompletionsEndpoint",
2021
"PublicEndpointParamsMcp",
@@ -61,9 +62,19 @@ class IndexingOptions(BaseModel):
6162
"""
6263

6364

65+
class MetadataSearchForAgents(BaseModel):
66+
hostname: str
67+
68+
zone_id: str
69+
70+
zone_name: str
71+
72+
6473
class Metadata(BaseModel):
6574
created_from_aisearch_wizard: Optional[bool] = None
6675

76+
search_for_agents: Optional[MetadataSearchForAgents] = None
77+
6778
worker_domain: Optional[str] = None
6879

6980

@@ -139,8 +150,7 @@ class RetrievalOptions(BaseModel):
139150
140151
'and' restricts candidates to documents containing all query terms; 'or'
141152
includes any document containing at least one term, ranked by BM25 relevance.
142-
Defaults to 'and'. Legacy values 'exact_match' and 'fuzzy_match' are accepted
143-
and map to 'and' and 'or' respectively.
153+
Defaults to 'and'.
144154
"""
145155

146156

src/cloudflare/types/aisearch/instance_delete_response.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"IndexMethod",
1616
"IndexingOptions",
1717
"Metadata",
18+
"MetadataSearchForAgents",
1819
"PublicEndpointParams",
1920
"PublicEndpointParamsChatCompletionsEndpoint",
2021
"PublicEndpointParamsMcp",
@@ -61,9 +62,19 @@ class IndexingOptions(BaseModel):
6162
"""
6263

6364

65+
class MetadataSearchForAgents(BaseModel):
66+
hostname: str
67+
68+
zone_id: str
69+
70+
zone_name: str
71+
72+
6473
class Metadata(BaseModel):
6574
created_from_aisearch_wizard: Optional[bool] = None
6675

76+
search_for_agents: Optional[MetadataSearchForAgents] = None
77+
6778
worker_domain: Optional[str] = None
6879

6980

@@ -139,8 +150,7 @@ class RetrievalOptions(BaseModel):
139150
140151
'and' restricts candidates to documents containing all query terms; 'or'
141152
includes any document containing at least one term, ranked by BM25 relevance.
142-
Defaults to 'and'. Legacy values 'exact_match' and 'fuzzy_match' are accepted
143-
and map to 'and' and 'or' respectively.
153+
Defaults to 'and'.
144154
"""
145155

146156

src/cloudflare/types/aisearch/instance_list_response.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"IndexMethod",
1616
"IndexingOptions",
1717
"Metadata",
18+
"MetadataSearchForAgents",
1819
"PublicEndpointParams",
1920
"PublicEndpointParamsChatCompletionsEndpoint",
2021
"PublicEndpointParamsMcp",
@@ -61,9 +62,19 @@ class IndexingOptions(BaseModel):
6162
"""
6263

6364

65+
class MetadataSearchForAgents(BaseModel):
66+
hostname: str
67+
68+
zone_id: str
69+
70+
zone_name: str
71+
72+
6473
class Metadata(BaseModel):
6574
created_from_aisearch_wizard: Optional[bool] = None
6675

76+
search_for_agents: Optional[MetadataSearchForAgents] = None
77+
6778
worker_domain: Optional[str] = None
6879

6980

@@ -139,8 +150,7 @@ class RetrievalOptions(BaseModel):
139150
140151
'and' restricts candidates to documents containing all query terms; 'or'
141152
includes any document containing at least one term, ranked by BM25 relevance.
142-
Defaults to 'and'. Legacy values 'exact_match' and 'fuzzy_match' are accepted
143-
and map to 'and' and 'or' respectively.
153+
Defaults to 'and'.
144154
"""
145155

146156

src/cloudflare/types/aisearch/instance_read_response.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"IndexMethod",
1616
"IndexingOptions",
1717
"Metadata",
18+
"MetadataSearchForAgents",
1819
"PublicEndpointParams",
1920
"PublicEndpointParamsChatCompletionsEndpoint",
2021
"PublicEndpointParamsMcp",
@@ -61,9 +62,19 @@ class IndexingOptions(BaseModel):
6162
"""
6263

6364

65+
class MetadataSearchForAgents(BaseModel):
66+
hostname: str
67+
68+
zone_id: str
69+
70+
zone_name: str
71+
72+
6473
class Metadata(BaseModel):
6574
created_from_aisearch_wizard: Optional[bool] = None
6675

76+
search_for_agents: Optional[MetadataSearchForAgents] = None
77+
6778
worker_domain: Optional[str] = None
6879

6980

@@ -139,8 +150,7 @@ class RetrievalOptions(BaseModel):
139150
140151
'and' restricts candidates to documents containing all query terms; 'or'
141152
includes any document containing at least one term, ranked by BM25 relevance.
142-
Defaults to 'and'. Legacy values 'exact_match' and 'fuzzy_match' are accepted
143-
and map to 'and' and 'or' respectively.
153+
Defaults to 'and'.
144154
"""
145155

146156

src/cloudflare/types/aisearch/instance_search_params.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,28 @@
99

1010
__all__ = [
1111
"InstanceSearchParams",
12-
"Message",
1312
"AISearchOptions",
1413
"AISearchOptionsCache",
1514
"AISearchOptionsQueryRewrite",
1615
"AISearchOptionsReranking",
1716
"AISearchOptionsRetrieval",
1817
"AISearchOptionsRetrievalBoostBy",
18+
"Message",
1919
]
2020

2121

2222
class InstanceSearchParams(TypedDict, total=False):
2323
account_id: Required[str]
2424

25-
messages: Required[Iterable[Message]]
26-
2725
aisearch_options: Annotated[AISearchOptions, PropertyInfo(alias="ai_search_options")]
2826

27+
messages: Iterable[Message]
2928

30-
class MessageTyped(TypedDict, total=False):
31-
content: Required[Optional[str]]
32-
33-
role: Required[Literal["system", "developer", "user", "assistant", "tool"]]
34-
29+
query: str
30+
"""A simple text query string.
3531
36-
Message: TypeAlias = Union[MessageTyped, Dict[str, object]]
32+
Alternative to 'messages' — provide either this or 'messages', not both.
33+
"""
3734

3835

3936
class AISearchOptionsCache(TypedDict, total=False):
@@ -128,8 +125,7 @@ class AISearchOptionsRetrieval(TypedDict, total=False):
128125
129126
'and' restricts candidates to documents containing all query terms; 'or'
130127
includes any document containing at least one term, ranked by BM25 relevance.
131-
Defaults to 'and'. Legacy values 'exact_match' and 'fuzzy_match' are accepted
132-
and map to 'and' and 'or' respectively.
128+
Defaults to 'and'.
133129
"""
134130

135131
match_threshold: float
@@ -149,3 +145,12 @@ class AISearchOptions(TypedDict, total=False):
149145
reranking: AISearchOptionsReranking
150146

151147
retrieval: AISearchOptionsRetrieval
148+
149+
150+
class MessageTyped(TypedDict, total=False):
151+
content: Required[Optional[str]]
152+
153+
role: Required[Literal["system", "developer", "user", "assistant", "tool"]]
154+
155+
156+
Message: TypeAlias = Union[MessageTyped, Dict[str, object]]

0 commit comments

Comments
 (0)