Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ authors = [{ name = "Replicate, Inc." }]
requires-python = ">=3.8"
dependencies = [
"httpx>=0.21.0,<1",
"httpx2>=2.12.0; python_version >= \"3.10\"",
"packaging",
"pydantic>1.10.7",
"typing_extensions>=4.5.0",
Expand Down
5 changes: 4 additions & 1 deletion replicate/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
Union,
)

import httpx
try:
import httpx2 as httpx
except ImportError:
import httpx
from typing_extensions import Unpack

from replicate.__about__ import __version__
Expand Down
5 changes: 4 additions & 1 deletion replicate/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from typing import TYPE_CHECKING, Optional

import httpx
try:
import httpx2 as httpx
except ImportError:
import httpx

if TYPE_CHECKING:
from replicate.prediction import Prediction
Expand Down
5 changes: 4 additions & 1 deletion replicate/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
overload,
)

import httpx
try:
import httpx2 as httpx
except ImportError:
import httpx
from typing_extensions import NotRequired, TypedDict, Unpack

from replicate.exceptions import ModelError, ReplicateError
Expand Down
5 changes: 4 additions & 1 deletion replicate/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
Union,
)

import httpx
try:
import httpx2 as httpx
except ImportError:
import httpx
from typing_extensions import Unpack

from replicate import identifier
Expand Down
3 changes: 3 additions & 0 deletions replicate/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
from replicate.resource import Namespace, Resource

if TYPE_CHECKING:
try:
import httpx2 as httpx
except ImportError:
import httpx


Expand Down