summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/needs_auth/HuggingChat.py
diff options
context:
space:
mode:
authorHeiner Lohaus <heiner@lohaus.eu>2023-10-09 13:33:20 +0200
committerHeiner Lohaus <heiner@lohaus.eu>2023-10-09 13:33:20 +0200
commitc6b33e527c9af9c72a615a7b23c8d40b5783862f (patch)
tree26a25d7b5bee6ba1e2ac484e1ad124a8e52b0b43 /g4f/Provider/needs_auth/HuggingChat.py
parentReadme: Create Provider with AI Tool (diff)
downloadgpt4free-c6b33e527c9af9c72a615a7b23c8d40b5783862f.tar
gpt4free-c6b33e527c9af9c72a615a7b23c8d40b5783862f.tar.gz
gpt4free-c6b33e527c9af9c72a615a7b23c8d40b5783862f.tar.bz2
gpt4free-c6b33e527c9af9c72a615a7b23c8d40b5783862f.tar.lz
gpt4free-c6b33e527c9af9c72a615a7b23c8d40b5783862f.tar.xz
gpt4free-c6b33e527c9af9c72a615a7b23c8d40b5783862f.tar.zst
gpt4free-c6b33e527c9af9c72a615a7b23c8d40b5783862f.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/needs_auth/HuggingChat.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/g4f/Provider/needs_auth/HuggingChat.py b/g4f/Provider/needs_auth/HuggingChat.py
index 1d500338..68c6713b 100644
--- a/g4f/Provider/needs_auth/HuggingChat.py
+++ b/g4f/Provider/needs_auth/HuggingChat.py
@@ -4,8 +4,9 @@ import json, uuid
from aiohttp import ClientSession
-from ...typing import AsyncGenerator
-from ..base_provider import AsyncGeneratorProvider, format_prompt, get_cookies
+from ...typing import AsyncResult, Messages
+from ..base_provider import AsyncGeneratorProvider
+from ..helper import format_prompt, get_cookies
class HuggingChat(AsyncGeneratorProvider):
@@ -18,12 +19,12 @@ class HuggingChat(AsyncGeneratorProvider):
async def create_async_generator(
cls,
model: str,
- messages: list[dict[str, str]],
+ messages: Messages,
stream: bool = True,
proxy: str = None,
cookies: dict = None,
**kwargs
- ) -> AsyncGenerator:
+ ) -> AsyncResult:
model = model if model else cls.model
if proxy and "://" not in proxy:
proxy = f"http://{proxy}"