2024-04-07 08:36:13 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
from .types import Client, ImageProvider
|
2024-04-06 19:27:21 +00:00
|
|
|
|
2024-04-07 08:36:13 +00:00
|
|
|
from ..Provider.BingCreateImages import BingCreateImages
|
|
|
|
from ..Provider.needs_auth import Gemini, OpenaiChat
|
|
|
|
from ..Provider.You import You
|
2024-04-06 19:27:21 +00:00
|
|
|
|
2024-04-06 19:24:48 +00:00
|
|
|
class ImageModels():
|
|
|
|
gemini = Gemini
|
|
|
|
openai = OpenaiChat
|
|
|
|
you = You
|
|
|
|
|
|
|
|
def __init__(self, client: Client) -> None:
|
|
|
|
self.client = client
|
|
|
|
self.default = BingCreateImages(proxy=self.client.get_proxy())
|
|
|
|
|
|
|
|
def get(self, name: str, default: ImageProvider = None) -> ImageProvider:
|
|
|
|
return getattr(self, name) if hasattr(self, name) else default or self.default
|