__init__.py 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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, HuggingFaceMedia
  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 .Dynaspark import Dynaspark
  25. from .Free2GPT import Free2GPT
  26. from .FreeGpt import FreeGpt
  27. from .GizAI import GizAI
  28. from .Glider import Glider
  29. from .Goabror import Goabror
  30. from .ImageLabs import ImageLabs
  31. from .Jmuz import Jmuz
  32. from .LambdaChat import LambdaChat
  33. from .Liaobots import Liaobots
  34. from .OIVSCode import OIVSCode
  35. from .PerplexityLabs import PerplexityLabs
  36. from .Pi import Pi
  37. from .Pizzagpt import Pizzagpt
  38. from .PollinationsAI import PollinationsAI
  39. from .PollinationsImage import PollinationsImage
  40. from .TeachAnything import TeachAnything
  41. from .TypeGPT import TypeGPT
  42. from .You import You
  43. from .Websim import Websim
  44. from .Yqcloud import Yqcloud
  45. import sys
  46. __modules__: list = [
  47. getattr(sys.modules[__name__], provider) for provider in dir()
  48. if not provider.startswith("__")
  49. ]
  50. __providers__: list[ProviderType] = [
  51. provider for provider in __modules__
  52. if isinstance(provider, type)
  53. and issubclass(provider, BaseProvider)
  54. ]
  55. __all__: list[str] = [
  56. provider.__name__ for provider in __providers__
  57. ]
  58. __map__: dict[str, ProviderType] = dict([
  59. (provider.__name__, provider) for provider in __providers__
  60. ])
  61. class ProviderUtils:
  62. convert: dict[str, ProviderType] = __map__