chat_embed_api.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # coding=utf-8
  2. """
  3. @project: MaxKB
  4. @Author:虎虎
  5. @file: chat_embed_api.py
  6. @date:2025/5/30 15:25
  7. @desc:
  8. """
  9. from drf_spectacular.types import OpenApiTypes
  10. from drf_spectacular.utils import OpenApiParameter
  11. from common.mixins.api_mixin import APIMixin
  12. from django.utils.translation import gettext_lazy as _
  13. from common.result import DefaultResultSerializer
  14. class ChatEmbedAPI(APIMixin):
  15. @staticmethod
  16. def get_parameters():
  17. return [
  18. OpenApiParameter(
  19. name="host",
  20. description=_("host"),
  21. type=OpenApiTypes.STR,
  22. location='query',
  23. required=False,
  24. ),
  25. OpenApiParameter(
  26. name="protocol",
  27. description=_("protocol"),
  28. type=OpenApiTypes.STR,
  29. location='query',
  30. required=False,
  31. ),
  32. OpenApiParameter(
  33. name="token",
  34. description=_("token"),
  35. type=OpenApiTypes.STR,
  36. location='query',
  37. required=False,
  38. )
  39. ]
  40. @staticmethod
  41. def get_response():
  42. return DefaultResultSerializer