diff options
author | Tekky <98614666+xtekky@users.noreply.github.com> | 2024-11-15 11:18:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-15 11:18:56 +0100 |
commit | f65ebd98518bc42bd83a9205f3eab9cb06de566a (patch) | |
tree | 82ceabb9503acd0e1301b6eb7e20493cc18f3672 /g4f/Provider/needs_auth/MetaAIAccount.py | |
parent | FIX: fix the url in the markdown output (md compliance), and the chunk/ImageResponse to str ! (#2353) (diff) | |
parent | quick fix for Conflicts (diff) | |
download | gpt4free-f65ebd98518bc42bd83a9205f3eab9cb06de566a.tar gpt4free-f65ebd98518bc42bd83a9205f3eab9cb06de566a.tar.gz gpt4free-f65ebd98518bc42bd83a9205f3eab9cb06de566a.tar.bz2 gpt4free-f65ebd98518bc42bd83a9205f3eab9cb06de566a.tar.lz gpt4free-f65ebd98518bc42bd83a9205f3eab9cb06de566a.tar.xz gpt4free-f65ebd98518bc42bd83a9205f3eab9cb06de566a.tar.zst gpt4free-f65ebd98518bc42bd83a9205f3eab9cb06de566a.zip |
Diffstat (limited to 'g4f/Provider/needs_auth/MetaAIAccount.py')
-rw-r--r-- | g4f/Provider/needs_auth/MetaAIAccount.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/g4f/Provider/needs_auth/MetaAIAccount.py b/g4f/Provider/needs_auth/MetaAIAccount.py new file mode 100644 index 00000000..2d54f3e0 --- /dev/null +++ b/g4f/Provider/needs_auth/MetaAIAccount.py @@ -0,0 +1,23 @@ +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 + parent = "MetaAI" + image_models = ["meta"] + + @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 |