__init__.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. from __future__ import annotations
  2. from ..providers.types import BaseProvider, ProviderType
  3. from ..providers.retry_provider import RetryProvider, IterListProvider
  4. from ..providers.base_provider import AsyncProvider, AsyncGeneratorProvider
  5. from ..providers.create_images import CreateImagesProvider
  6. from .deprecated import *
  7. from .needs_auth import *
  8. from .not_working import *
  9. from .local import *
  10. from .hf import HuggingFace, HuggingChat, HuggingFaceAPI, HuggingFaceInference
  11. from .hf_space import HuggingSpace
  12. from .mini_max import HailuoAI, MiniMax
  13. from .template import OpenaiTemplate, BackendApi
  14. from .Blackbox import Blackbox
  15. from .BlackboxAPI import BlackboxAPI
  16. from .ChatGLM import ChatGLM
  17. from .ChatGpt import ChatGpt
  18. from .ChatGptEs import ChatGptEs
  19. from .Cloudflare import Cloudflare
  20. from .Copilot import Copilot
  21. from .DDG import DDG
  22. from .DeepInfraChat import DeepInfraChat
  23. from .Free2GPT import Free2GPT
  24. from .FreeGpt import FreeGpt
  25. from .GizAI import GizAI
  26. from .Glider import Glider
  27. from .ImageLabs import ImageLabs
  28. from .Jmuz import Jmuz
  29. from .Liaobots import Liaobots
  30. from .Mhystical import Mhystical
  31. from .OIVSCode import OIVSCode
  32. from .PerplexityLabs import PerplexityLabs
  33. from .Pi import Pi
  34. from .Pizzagpt import Pizzagpt
  35. from .PollinationsAI import PollinationsAI
  36. from .PollinationsImage import PollinationsImage
  37. from .Prodia import Prodia
  38. from .TeachAnything import TeachAnything
  39. from .You import You
  40. from .Yqcloud import Yqcloud
  41. import sys
  42. __modules__: list = [
  43. getattr(sys.modules[__name__], provider) for provider in dir()
  44. if not provider.startswith("__")
  45. ]
  46. __providers__: list[ProviderType] = [
  47. provider for provider in __modules__
  48. if isinstance(provider, type)
  49. and issubclass(provider, BaseProvider)
  50. ]
  51. __providers__ = __providers__ + HuggingSpace.providers
  52. __all__: list[str] = [
  53. provider.__name__ for provider in __providers__
  54. ]
  55. __map__: dict[str, ProviderType] = dict([
  56. (provider.__name__, provider) for provider in __providers__
  57. ])
  58. class ProviderUtils:
  59. convert: dict[str, ProviderType] = __map__