Skip to content

Commit 7b1536e

Browse files
fix type mismatch between raw_client and combined_raw_client
1 parent abbaf21 commit 7b1536e

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/cohere/client_v2.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
from .client import Client, AsyncClient
2-
from .v2.client import V2Client, AsyncV2Client
3-
import typing
4-
from .environment import ClientEnvironment
51
import os
6-
import httpx
2+
import typing
73
from concurrent.futures import ThreadPoolExecutor
84

5+
import httpx
6+
from .client import AsyncClient, Client
7+
from .environment import ClientEnvironment
8+
from .v2.client import AsyncRawV2Client, AsyncV2Client, RawV2Client, V2Client
9+
910

1011
class _CombinedRawClient:
1112
"""Proxy that combines v1 and v2 raw clients.
@@ -57,7 +58,7 @@ def __init__(
5758
self,
5859
client_wrapper=self._client_wrapper
5960
)
60-
self._raw_client = _CombinedRawClient(v1_raw, self._raw_client)
61+
self._raw_client = typing.cast(RawV2Client, _CombinedRawClient(v1_raw, self._raw_client))
6162

6263

6364
class AsyncClientV2(AsyncV2Client, AsyncClient): # type: ignore
@@ -90,4 +91,4 @@ def __init__(
9091
self,
9192
client_wrapper=self._client_wrapper
9293
)
93-
self._raw_client = _CombinedRawClient(v1_raw, self._raw_client)
94+
self._raw_client = typing.cast(AsyncRawV2Client, _CombinedRawClient(v1_raw, self._raw_client))

0 commit comments

Comments
 (0)