Skip to content

Commit

Permalink
chore(internal): revert recent options change (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored Nov 23, 2023
1 parent e469617 commit ddff306
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
8 changes: 2 additions & 6 deletions src/anthropic_bedrock/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ def _request(
self._prepare_request(request)

try:
response = self._client.send(request, auth=self.custom_auth, stream=stream or options.stream or False)
response = self._client.send(request, auth=self.custom_auth, stream=stream)
log.debug(
'HTTP Request: %s %s "%i %s"', request.method, request.url, response.status_code, response.reason_phrase
)
Expand Down Expand Up @@ -1304,7 +1304,7 @@ async def _request(
await self._prepare_request(request)

try:
response = await self._client.send(request, auth=self.custom_auth, stream=stream or options.stream or False)
response = await self._client.send(request, auth=self.custom_auth, stream=stream)
log.debug(
'HTTP Request: %s %s "%i %s"', request.method, request.url, response.status_code, response.reason_phrase
)
Expand Down Expand Up @@ -1541,7 +1541,6 @@ def make_request_options(
idempotency_key: str | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
post_parser: PostParser | NotGiven = NOT_GIVEN,
stream: bool | None = None,
) -> RequestOptions:
"""Create a dict of type RequestOptions without keys of NotGiven values."""
options: RequestOptions = {}
Expand All @@ -1563,9 +1562,6 @@ def make_request_options(
if idempotency_key is not None:
options["idempotency_key"] = idempotency_key

if stream is not None:
options["stream"] = stream

if is_given(post_parser):
# internal
options["post_parser"] = post_parser # type: ignore
Expand Down
2 changes: 0 additions & 2 deletions src/anthropic_bedrock/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ class FinalRequestOptionsInput(TypedDict, total=False):
params: Query
headers: Headers
max_retries: int
stream: bool | None
timeout: float | Timeout | None
files: HttpxRequestFiles | None
idempotency_key: str
Expand All @@ -421,7 +420,6 @@ class FinalRequestOptions(pydantic.BaseModel):
timeout: Union[float, Timeout, None, NotGiven] = NotGiven()
files: Union[HttpxRequestFiles, None] = None
idempotency_key: Union[str, None] = None
stream: Union[bool, None] = None
post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()

# It should be noted that we cannot use `json` here as that would override
Expand Down
1 change: 0 additions & 1 deletion src/anthropic_bedrock/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ async def aclose(self) -> None:
class RequestOptions(TypedDict, total=False):
headers: Headers
max_retries: int
stream: bool
timeout: float | Timeout | None
params: Query
extra_json: AnyMapping
Expand Down

0 comments on commit ddff306

Please sign in to comment.