2024-04-06 14:41:30 -04:00
|
|
|
from ..providers.types import BaseProvider, ProviderType, FinishReason
|
2024-04-06 14:31:13 -04:00
|
|
|
from typing import Union, Iterator
|
2024-04-06 14:41:30 -04:00
|
|
|
|
2024-04-06 14:31:13 -04:00
|
|
|
ImageProvider = Union[BaseProvider, object]
|
|
|
|
Proxies = Union[dict, str]
|
|
|
|
IterResponse = Iterator[Union[ChatCompletion, ChatCompletionChunk]]
|
2024-04-06 14:41:30 -04:00
|
|
|
|
|
|
|
class Client():
|
|
|
|
def __init__(
|
|
|
|
self,
|
|
|
|
api_key: str = None,
|
|
|
|
proxies: Proxies = None,
|
|
|
|
provider: ProviderType = None,
|
|
|
|
image_provider: ImageProvider = None,
|
|
|
|
**kwargs
|
|
|
|
) -> None:
|
|
|
|
self.api_key: str = api_key
|
|
|
|
self.proxies: Proxies = proxies
|
|
|
|
self.chat: Chat = Chat(self, provider)
|
|
|
|
self.images: Images = Images(self, image_provider)
|