2024-04-21 08:22:59 +03:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2024-11-06 18:25:09 +03:00
|
|
|
from ...typing import AsyncResult, Messages, Cookies
|
|
|
|
from ..helper import format_prompt, get_cookies
|
|
|
|
from ..MetaAI import MetaAI
|
2024-04-21 08:22:59 +03:00
|
|
|
|
|
|
|
class MetaAIAccount(MetaAI):
|
|
|
|
needs_auth = True
|
2024-04-22 02:27:48 +03:00
|
|
|
parent = "MetaAI"
|
2024-04-21 16:15:55 +03:00
|
|
|
image_models = ["meta"]
|
2024-04-21 08:22:59 +03:00
|
|
|
|
|
|
|
@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):
|
2024-11-06 18:25:09 +03:00
|
|
|
yield chunk
|