66
77import httpx
88
9- from ...._types import Body , Query , Headers , NoneType , NotGiven , not_given
9+ from ...._types import Body , Omit , Query , Headers , NoneType , NotGiven , omit , not_given
1010from ...._utils import path_template , maybe_transform , async_maybe_transform
1111from ...._compat import cached_property
1212from ...._resource import SyncAPIResource , AsyncAPIResource
1818)
1919from ...._base_client import make_request_options
2020from ....types .ai .assistants import canary_deploy_create_params , canary_deploy_update_params
21- from ....types .ai .assistants .version_config_param import VersionConfigParam
2221from ....types .ai .assistants .canary_deploy_response import CanaryDeployResponse
2322
2423__all__ = ["CanaryDeploysResource" , "AsyncCanaryDeploysResource" ]
@@ -50,7 +49,7 @@ def create(
5049 self ,
5150 assistant_id : str ,
5251 * ,
53- versions : Iterable [VersionConfigParam ] ,
52+ rules : Iterable [canary_deploy_create_params . Rule ] | Omit = omit ,
5453 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5554 # The extra values given here take precedence over values defined on the client or passed to this method.
5655 extra_headers : Headers | None = None ,
@@ -65,8 +64,6 @@ def create(
6564 traffic percentages for A/B testing or gradual rollouts of assistant versions.
6665
6766 Args:
68- versions: List of version configurations
69-
7067 extra_headers: Send extra headers
7168
7269 extra_query: Add additional query parameters to the request
@@ -79,7 +76,7 @@ def create(
7976 raise ValueError (f"Expected a non-empty value for `assistant_id` but received { assistant_id !r} " )
8077 return self ._post (
8178 path_template ("/ai/assistants/{assistant_id}/canary-deploys" , assistant_id = assistant_id ),
82- body = maybe_transform ({"versions " : versions }, canary_deploy_create_params .CanaryDeployCreateParams ),
79+ body = maybe_transform ({"rules " : rules }, canary_deploy_create_params .CanaryDeployCreateParams ),
8380 options = make_request_options (
8481 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
8582 ),
@@ -126,7 +123,7 @@ def update(
126123 self ,
127124 assistant_id : str ,
128125 * ,
129- versions : Iterable [VersionConfigParam ] ,
126+ rules : Iterable [canary_deploy_update_params . Rule ] | Omit = omit ,
130127 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
131128 # The extra values given here take precedence over values defined on the client or passed to this method.
132129 extra_headers : Headers | None = None ,
@@ -142,8 +139,6 @@ def update(
142139 request.
143140
144141 Args:
145- versions: List of version configurations
146-
147142 extra_headers: Send extra headers
148143
149144 extra_query: Add additional query parameters to the request
@@ -156,7 +151,7 @@ def update(
156151 raise ValueError (f"Expected a non-empty value for `assistant_id` but received { assistant_id !r} " )
157152 return self ._put (
158153 path_template ("/ai/assistants/{assistant_id}/canary-deploys" , assistant_id = assistant_id ),
159- body = maybe_transform ({"versions " : versions }, canary_deploy_update_params .CanaryDeployUpdateParams ),
154+ body = maybe_transform ({"rules " : rules }, canary_deploy_update_params .CanaryDeployUpdateParams ),
160155 options = make_request_options (
161156 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
162157 ),
@@ -226,7 +221,7 @@ async def create(
226221 self ,
227222 assistant_id : str ,
228223 * ,
229- versions : Iterable [VersionConfigParam ] ,
224+ rules : Iterable [canary_deploy_create_params . Rule ] | Omit = omit ,
230225 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
231226 # The extra values given here take precedence over values defined on the client or passed to this method.
232227 extra_headers : Headers | None = None ,
@@ -241,8 +236,6 @@ async def create(
241236 traffic percentages for A/B testing or gradual rollouts of assistant versions.
242237
243238 Args:
244- versions: List of version configurations
245-
246239 extra_headers: Send extra headers
247240
248241 extra_query: Add additional query parameters to the request
@@ -255,9 +248,7 @@ async def create(
255248 raise ValueError (f"Expected a non-empty value for `assistant_id` but received { assistant_id !r} " )
256249 return await self ._post (
257250 path_template ("/ai/assistants/{assistant_id}/canary-deploys" , assistant_id = assistant_id ),
258- body = await async_maybe_transform (
259- {"versions" : versions }, canary_deploy_create_params .CanaryDeployCreateParams
260- ),
251+ body = await async_maybe_transform ({"rules" : rules }, canary_deploy_create_params .CanaryDeployCreateParams ),
261252 options = make_request_options (
262253 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
263254 ),
@@ -304,7 +295,7 @@ async def update(
304295 self ,
305296 assistant_id : str ,
306297 * ,
307- versions : Iterable [VersionConfigParam ] ,
298+ rules : Iterable [canary_deploy_update_params . Rule ] | Omit = omit ,
308299 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
309300 # The extra values given here take precedence over values defined on the client or passed to this method.
310301 extra_headers : Headers | None = None ,
@@ -320,8 +311,6 @@ async def update(
320311 request.
321312
322313 Args:
323- versions: List of version configurations
324-
325314 extra_headers: Send extra headers
326315
327316 extra_query: Add additional query parameters to the request
@@ -334,9 +323,7 @@ async def update(
334323 raise ValueError (f"Expected a non-empty value for `assistant_id` but received { assistant_id !r} " )
335324 return await self ._put (
336325 path_template ("/ai/assistants/{assistant_id}/canary-deploys" , assistant_id = assistant_id ),
337- body = await async_maybe_transform (
338- {"versions" : versions }, canary_deploy_update_params .CanaryDeployUpdateParams
339- ),
326+ body = await async_maybe_transform ({"rules" : rules }, canary_deploy_update_params .CanaryDeployUpdateParams ),
340327 options = make_request_options (
341328 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
342329 ),
0 commit comments