Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(client): add constants to client instances as well #95

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/anthropic/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import httpx
from tokenizers import Tokenizer # type: ignore[import]

from . import resources
from . import resources, _constants
from ._qs import Querystring
from ._types import (
NOT_GIVEN,
Expand Down Expand Up @@ -53,6 +53,10 @@ class Anthropic(SyncAPIClient):
api_key: str | None
auth_token: str | None

# constants
HUMAN_PROMPT = _constants.HUMAN_PROMPT
AI_PROMPT = _constants.AI_PROMPT

def __init__(
self,
*,
Expand Down Expand Up @@ -240,6 +244,10 @@ class AsyncAnthropic(AsyncAPIClient):
api_key: str | None
auth_token: str | None

# constants
HUMAN_PROMPT = _constants.HUMAN_PROMPT
AI_PROMPT = _constants.AI_PROMPT

def __init__(
self,
*,
Expand Down