summaryrefslogblamecommitdiffstats
path: root/g4f/client/image_models.py
blob: 1fd2d0b501ebf97c3280f4579f9753f9de81905e (plain) (tree)
1
2
3
4
5
6





                                                       










                                                                                      
from .Provider.BingCreateImages import BingCreateImages
from .Provider.needs_auth import Gemini, OpenaiChat
from ..Provider.You import You

from .types import Client

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