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

chore(internal): update resource client type #318

Merged
merged 1 commit into from
Jan 22, 2024
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
12 changes: 5 additions & 7 deletions src/anthropic/_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@

import time
import asyncio
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from ._client import Anthropic, AsyncAnthropic
from ._base_client import SyncAPIClient, AsyncAPIClient


class SyncAPIResource:
_client: Anthropic
_client: SyncAPIClient

def __init__(self, client: Anthropic) -> None:
def __init__(self, client: SyncAPIClient) -> None:
self._client = client
self._get = client.get
self._post = client.post
Expand All @@ -27,9 +25,9 @@ def _sleep(self, seconds: float) -> None:


class AsyncAPIResource:
_client: AsyncAnthropic
_client: AsyncAPIClient

def __init__(self, client: AsyncAnthropic) -> None:
def __init__(self, client: AsyncAPIClient) -> None:
self._client = client
self._get = client.get
self._post = client.post
Expand Down