Skip to content

Commit a215517

Browse files
committed
SDK regeneration
1 parent 04819f4 commit a215517

File tree

7 files changed

+29
-24
lines changed

7 files changed

+29
-24
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "credal"
33

44
[tool.poetry]
55
name = "credal"
6-
version = "0.0.22"
6+
version = "0.0.23"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ client.actions.invoke_action(
8585
<dl>
8686
<dd>
8787

88-
**human_confirmation_channel:** `HumanConfirmationChannel`Where we should ask for human confirmation if necessary
88+
**require_human_confirmation:** `bool`If true, then before executing the action we will ask for a human confirmation in Slack. If false, we may still ask for human confirmation if it's required by your organization admin.
8989

9090

9191
</dd>
@@ -121,7 +121,7 @@ client.actions.invoke_action(
121121
<dl>
122122
<dd>
123123

124-
**require_human_confirmation:** `typing.Optional[bool]`If true, then before executing the action we will ask for a human confirmation in Slack. If false, we may still ask for human confirmation if it's required by your organization admin.
124+
**human_confirmation_channel:** `typing.Optional[HumanConfirmationChannel]`Where we should ask for human confirmation if necessary
125125

126126

127127
</dd>

requirements.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
httpx>=0.21.2
2+
httpx-sse==0.4.0
3+
pydantic>= 1.9.2
4+
pydantic-core==^2.18.2
5+
typing_extensions>= 4.0.0

src/credal/actions/client.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ def invoke_action(
2525
*,
2626
action_id: uuid.UUID,
2727
user_email: str,
28-
human_confirmation_channel: HumanConfirmationChannel,
28+
require_human_confirmation: bool,
2929
justification: str,
3030
audit_log_id: uuid.UUID,
3131
action_inputs: typing.Optional[typing.Any] = OMIT,
32-
require_human_confirmation: typing.Optional[bool] = OMIT,
32+
human_confirmation_channel: typing.Optional[HumanConfirmationChannel] = OMIT,
3333
request_options: typing.Optional[RequestOptions] = None,
3434
) -> InvokeActionResponse:
3535
"""
@@ -43,8 +43,8 @@ def invoke_action(
4343
The user who we should take the action on behalf of
4444
4545
46-
human_confirmation_channel : HumanConfirmationChannel
47-
Where we should ask for human confirmation if necessary
46+
require_human_confirmation : bool
47+
If true, then before executing the action we will ask for a human confirmation in Slack. If false, we may still ask for human confirmation if it's required by your organization admin.
4848
4949
5050
justification : str
@@ -59,8 +59,8 @@ def invoke_action(
5959
The inputs needed to execute the action
6060
6161
62-
require_human_confirmation : typing.Optional[bool]
63-
If true, then before executing the action we will ask for a human confirmation in Slack. If false, we may still ask for human confirmation if it's required by your organization admin.
62+
human_confirmation_channel : typing.Optional[HumanConfirmationChannel]
63+
Where we should ask for human confirmation if necessary
6464
6565
6666
request_options : typing.Optional[RequestOptions]
@@ -140,11 +140,11 @@ async def invoke_action(
140140
*,
141141
action_id: uuid.UUID,
142142
user_email: str,
143-
human_confirmation_channel: HumanConfirmationChannel,
143+
require_human_confirmation: bool,
144144
justification: str,
145145
audit_log_id: uuid.UUID,
146146
action_inputs: typing.Optional[typing.Any] = OMIT,
147-
require_human_confirmation: typing.Optional[bool] = OMIT,
147+
human_confirmation_channel: typing.Optional[HumanConfirmationChannel] = OMIT,
148148
request_options: typing.Optional[RequestOptions] = None,
149149
) -> InvokeActionResponse:
150150
"""
@@ -158,8 +158,8 @@ async def invoke_action(
158158
The user who we should take the action on behalf of
159159
160160
161-
human_confirmation_channel : HumanConfirmationChannel
162-
Where we should ask for human confirmation if necessary
161+
require_human_confirmation : bool
162+
If true, then before executing the action we will ask for a human confirmation in Slack. If false, we may still ask for human confirmation if it's required by your organization admin.
163163
164164
165165
justification : str
@@ -174,8 +174,8 @@ async def invoke_action(
174174
The inputs needed to execute the action
175175
176176
177-
require_human_confirmation : typing.Optional[bool]
178-
If true, then before executing the action we will ask for a human confirmation in Slack. If false, we may still ask for human confirmation if it's required by your organization admin.
177+
human_confirmation_channel : typing.Optional[HumanConfirmationChannel]
178+
Where we should ask for human confirmation if necessary
179179
180180
181181
request_options : typing.Optional[RequestOptions]

src/credal/core/client_wrapper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_headers(self) -> typing.Dict[str, str]:
2222
headers: typing.Dict[str, str] = {
2323
"X-Fern-Language": "Python",
2424
"X-Fern-SDK-Name": "credal",
25-
"X-Fern-SDK-Version": "0.0.22",
25+
"X-Fern-SDK-Version": "0.0.23",
2626
}
2727
headers["Authorization"] = f"Bearer {self._get_api_key()}"
2828
return headers

src/credal/core/http_client.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ def _retry_timeout(response: httpx.Response, retries: int) -> float:
8585

8686

8787
def _should_retry(response: httpx.Response) -> bool:
88-
retriable_400s = [429, 408, 409]
89-
return response.status_code >= 500 or response.status_code in retriable_400s
88+
retryable_400s = [429, 408, 409]
89+
return response.status_code >= 500 or response.status_code in retryable_400s
9090

9191

9292
def remove_omit_from_dict(
@@ -183,7 +183,7 @@ def request(
183183
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
184184
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
185185
request_options: typing.Optional[RequestOptions] = None,
186-
retries: int = 0,
186+
retries: int = 2,
187187
omit: typing.Optional[typing.Any] = None,
188188
) -> httpx.Response:
189189
base_url = self.get_base_url(base_url)
@@ -269,7 +269,7 @@ def stream(
269269
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
270270
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
271271
request_options: typing.Optional[RequestOptions] = None,
272-
retries: int = 0,
272+
retries: int = 2,
273273
omit: typing.Optional[typing.Any] = None,
274274
) -> typing.Iterator[httpx.Response]:
275275
base_url = self.get_base_url(base_url)
@@ -359,7 +359,7 @@ async def request(
359359
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
360360
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
361361
request_options: typing.Optional[RequestOptions] = None,
362-
retries: int = 0,
362+
retries: int = 2,
363363
omit: typing.Optional[typing.Any] = None,
364364
) -> httpx.Response:
365365
base_url = self.get_base_url(base_url)
@@ -445,7 +445,7 @@ async def stream(
445445
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
446446
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
447447
request_options: typing.Optional[RequestOptions] = None,
448-
retries: int = 0,
448+
retries: int = 2,
449449
omit: typing.Optional[typing.Any] = None,
450450
) -> typing.AsyncIterator[httpx.Response]:
451451
base_url = self.get_base_url(base_url)

src/credal/core/pydantic_utilities.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def to_jsonable_with_fallback(
7979
class UniversalBaseModel(pydantic.BaseModel):
8080
if IS_PYDANTIC_V2:
8181
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
82-
# Allow fields begining with `model_` to be used in the model
82+
# Allow fields beginning with `model_` to be used in the model
8383
protected_namespaces=(),
8484
) # type: ignore # Pydantic v2
8585

@@ -128,7 +128,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
128128
Override the default dict method to `exclude_unset` by default. This function patches
129129
`exclude_unset` to work include fields within non-None default values.
130130
"""
131-
# Note: the logic here is multi-plexed given the levers exposed in Pydantic V1 vs V2
131+
# Note: the logic here is multiplexed given the levers exposed in Pydantic V1 vs V2
132132
# Pydantic V1's .dict can be extremely slow, so we do not want to call it twice.
133133
#
134134
# We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models

0 commit comments

Comments
 (0)