summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/base_provider.py
diff options
context:
space:
mode:
authorHeiner Lohaus <heiner@lohaus.eu>2023-10-10 09:49:29 +0200
committerHeiner Lohaus <heiner@lohaus.eu>2023-10-10 09:49:29 +0200
commit53192b86b129380660f7454170fa987faf2da3c5 (patch)
tree5797a34479840692f2ae5db9e63deacac9732bd7 /g4f/Provider/base_provider.py
parent ~ | g4f `v-0.1.5.7` (diff)
downloadgpt4free-53192b86b129380660f7454170fa987faf2da3c5.tar
gpt4free-53192b86b129380660f7454170fa987faf2da3c5.tar.gz
gpt4free-53192b86b129380660f7454170fa987faf2da3c5.tar.bz2
gpt4free-53192b86b129380660f7454170fa987faf2da3c5.tar.lz
gpt4free-53192b86b129380660f7454170fa987faf2da3c5.tar.xz
gpt4free-53192b86b129380660f7454170fa987faf2da3c5.tar.zst
gpt4free-53192b86b129380660f7454170fa987faf2da3c5.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/base_provider.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/g4f/Provider/base_provider.py b/g4f/Provider/base_provider.py
index 35764081..c54b98e5 100644
--- a/g4f/Provider/base_provider.py
+++ b/g4f/Provider/base_provider.py
@@ -5,7 +5,7 @@ from concurrent.futures import ThreadPoolExecutor
from abc import ABC, abstractmethod
from .helper import get_event_loop, get_cookies, format_prompt
-from ..typing import AsyncGenerator, CreateResult
+from ..typing import CreateResult, AsyncResult, Messages
class BaseProvider(ABC):
@@ -20,7 +20,7 @@ class BaseProvider(ABC):
@abstractmethod
def create_completion(
model: str,
- messages: list[dict[str, str]],
+ messages: Messages,
stream: bool,
**kwargs
) -> CreateResult:
@@ -30,7 +30,7 @@ class BaseProvider(ABC):
async def create_async(
cls,
model: str,
- messages: list[dict[str, str]],
+ messages: Messages,
*,
loop: AbstractEventLoop = None,
executor: ThreadPoolExecutor = None,
@@ -69,7 +69,7 @@ class AsyncProvider(BaseProvider):
def create_completion(
cls,
model: str,
- messages: list[dict[str, str]],
+ messages: Messages,
stream: bool = False,
**kwargs
) -> CreateResult:
@@ -81,7 +81,7 @@ class AsyncProvider(BaseProvider):
@abstractmethod
async def create_async(
model: str,
- messages: list[dict[str, str]],
+ messages: Messages,
**kwargs
) -> str:
raise NotImplementedError()
@@ -94,7 +94,7 @@ class AsyncGeneratorProvider(AsyncProvider):
def create_completion(
cls,
model: str,
- messages: list[dict[str, str]],
+ messages: Messages,
stream: bool = True,
**kwargs
) -> CreateResult:
@@ -116,7 +116,7 @@ class AsyncGeneratorProvider(AsyncProvider):
async def create_async(
cls,
model: str,
- messages: list[dict[str, str]],
+ messages: Messages,
**kwargs
) -> str:
return "".join([
@@ -132,7 +132,7 @@ class AsyncGeneratorProvider(AsyncProvider):
@abstractmethod
def create_async_generator(
model: str,
- messages: list[dict[str, str]],
+ messages: Messages,
**kwargs
- ) -> AsyncGenerator:
+ ) -> AsyncResult:
raise NotImplementedError() \ No newline at end of file