summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/MetaAIAccount.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-21 07:22:59 +0200
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-21 07:22:59 +0200
commitdb2d6cffd9268e8842f0c2aa8e062c0e19d88d28 (patch)
tree2b44e3ec6e21a8c1270f3d84a4a1f0efb360d37b /g4f/Provider/MetaAIAccount.py
parentDisable Bing integration test (diff)
downloadgpt4free-db2d6cffd9268e8842f0c2aa8e062c0e19d88d28.tar
gpt4free-db2d6cffd9268e8842f0c2aa8e062c0e19d88d28.tar.gz
gpt4free-db2d6cffd9268e8842f0c2aa8e062c0e19d88d28.tar.bz2
gpt4free-db2d6cffd9268e8842f0c2aa8e062c0e19d88d28.tar.lz
gpt4free-db2d6cffd9268e8842f0c2aa8e062c0e19d88d28.tar.xz
gpt4free-db2d6cffd9268e8842f0c2aa8e062c0e19d88d28.tar.zst
gpt4free-db2d6cffd9268e8842f0c2aa8e062c0e19d88d28.zip
Diffstat (limited to 'g4f/Provider/MetaAIAccount.py')
-rw-r--r--g4f/Provider/MetaAIAccount.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/g4f/Provider/MetaAIAccount.py b/g4f/Provider/MetaAIAccount.py
new file mode 100644
index 00000000..8be2318e
--- /dev/null
+++ b/g4f/Provider/MetaAIAccount.py
@@ -0,0 +1,21 @@
+from __future__ import annotations
+
+from ..typing import AsyncResult, Messages, Cookies
+from .helper import format_prompt, get_cookies
+from .MetaAI import MetaAI
+
+class MetaAIAccount(MetaAI):
+ needs_auth = True
+
+ @classmethod
+ async def create_async_generator(
+ cls,
+ model: str,
+ messages: Messages,
+ proxy: str = None,
+ cookies: Cookies = None,
+ **kwargs
+ ) -> AsyncResult:
+ cookies = get_cookies(".meta.ai", True, True) if cookies is None else cookies
+ async for chunk in cls(proxy).prompt(format_prompt(messages), cookies):
+ yield chunk \ No newline at end of file