__init__.py 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 *
  12. from .mini_max import HailuoAI, MiniMax
  13. from .template import OpenaiTemplate, BackendApi
  14. from .AllenAI import AllenAI
  15. from .ARTA import ARTA
  16. from .Blackbox import Blackbox
  17. from .ChatGLM import ChatGLM
  18. from .ChatGpt import ChatGpt
  19. from .ChatGptEs import ChatGptEs
  20. from .Cloudflare import Cloudflare
  21. from .Copilot import Copilot
  22. from .DDG import DDG
  23. from .DeepInfraChat import DeepInfraChat
  24. from .Free2GPT import Free2GPT
  25. from .FreeGpt import FreeGpt
  26. from .GizAI import GizAI
  27. from .Glider import Glider
  28. from .ImageLabs import ImageLabs
  29. from .Jmuz import Jmuz
  30. from .Liaobots import Liaobots
  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 .TeachAnything import TeachAnything
  38. from .You import You
  39. from .Yqcloud import Yqcloud
  40. import sys
  41. __modules__: list = [
  42. getattr(sys.modules[__name__], provider) for provider in dir()
  43. if not provider.startswith("__")
  44. ]
  45. __providers__: list[ProviderType] = [
  46. provider for provider in __modules__
  47. if isinstance(provider, type)
  48. and issubclass(provider, BaseProvider)
  49. ]
  50. __all__: list[str] = [
  51. provider.__name__ for provider in __providers__
  52. ]
  53. __map__: dict[str, ProviderType] = dict([
  54. (provider.__name__, provider) for provider in __providers__
  55. ])
  56. class ProviderUtils:
  57. convert: dict[str, ProviderType] = __map__