Skip to content

Commit

Permalink
chore(internal): minor reformatting of code (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored and rattrayalex committed Jul 29, 2023
1 parent 2520a03 commit 1175572
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/anthropic/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,14 @@ def __init__(
"""Construct a new synchronous anthropic client instance.
This automatically infers the following arguments from their corresponding environment variables if they are not provided:
- `auth_token` from `ANTHROPIC_AUTH_TOKEN`
- `api_key` from `ANTHROPIC_API_KEY`
- `auth_token` from `ANTHROPIC_AUTH_TOKEN`
"""
api_key = api_key or os.environ.get("ANTHROPIC_API_KEY", None)
self.api_key = api_key

auth_token_envvar = os.environ.get("ANTHROPIC_AUTH_TOKEN", None)
self.auth_token = auth_token or auth_token_envvar or None

if base_url is None:
base_url = f"https://api.anthropic.com"
Expand All @@ -103,11 +107,6 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)

self.api_key = api_key

auth_token_envvar = os.environ.get("ANTHROPIC_AUTH_TOKEN", None)
self.auth_token = auth_token or auth_token_envvar or None

self._default_stream_cls = Stream

self.completions = resources.Completions(self)
Expand Down Expand Up @@ -270,10 +269,14 @@ def __init__(
"""Construct a new async anthropic client instance.
This automatically infers the following arguments from their corresponding environment variables if they are not provided:
- `auth_token` from `ANTHROPIC_AUTH_TOKEN`
- `api_key` from `ANTHROPIC_API_KEY`
- `auth_token` from `ANTHROPIC_AUTH_TOKEN`
"""
api_key = api_key or os.environ.get("ANTHROPIC_API_KEY", None)
self.api_key = api_key

auth_token_envvar = os.environ.get("ANTHROPIC_AUTH_TOKEN", None)
self.auth_token = auth_token or auth_token_envvar or None

if base_url is None:
base_url = f"https://api.anthropic.com"
Expand All @@ -291,11 +294,6 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)

self.api_key = api_key

auth_token_envvar = os.environ.get("ANTHROPIC_AUTH_TOKEN", None)
self.auth_token = auth_token or auth_token_envvar or None

self._default_stream_cls = AsyncStream

self.completions = resources.AsyncCompletions(self)
Expand Down

0 comments on commit 1175572

Please sign in to comment.