summaryrefslogtreecommitdiffstats
path: root/g4f/client
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-04-06 20:41:30 +0200
committerGitHub <noreply@github.com>2024-04-06 20:41:30 +0200
commitb4399866eebf0ba02cd0251fda2f752493620f1a (patch)
treeec10f557a7a065395686c8440adfc6f3821f5294 /g4f/client
parentUpdate stubs.py (diff)
downloadgpt4free-b4399866eebf0ba02cd0251fda2f752493620f1a.tar
gpt4free-b4399866eebf0ba02cd0251fda2f752493620f1a.tar.gz
gpt4free-b4399866eebf0ba02cd0251fda2f752493620f1a.tar.bz2
gpt4free-b4399866eebf0ba02cd0251fda2f752493620f1a.tar.lz
gpt4free-b4399866eebf0ba02cd0251fda2f752493620f1a.tar.xz
gpt4free-b4399866eebf0ba02cd0251fda2f752493620f1a.tar.zst
gpt4free-b4399866eebf0ba02cd0251fda2f752493620f1a.zip
Diffstat (limited to 'g4f/client')
-rw-r--r--g4f/client/types.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/g4f/client/types.py b/g4f/client/types.py
index 69b11d05..1c33e6c2 100644
--- a/g4f/client/types.py
+++ b/g4f/client/types.py
@@ -1,5 +1,20 @@
-from ..providers.types import BaseProvider, ProviderType
+from ..providers.types import BaseProvider, ProviderType, FinishReason
from typing import Union, Iterator
+
ImageProvider = Union[BaseProvider, object]
Proxies = Union[dict, str]
IterResponse = Iterator[Union[ChatCompletion, ChatCompletionChunk]]
+
+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)