alpha.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
  2. from __future__ import annotations
  3. from .graders import (
  4. Graders,
  5. AsyncGraders,
  6. GradersWithRawResponse,
  7. AsyncGradersWithRawResponse,
  8. GradersWithStreamingResponse,
  9. AsyncGradersWithStreamingResponse,
  10. )
  11. from ...._compat import cached_property
  12. from ...._resource import SyncAPIResource, AsyncAPIResource
  13. __all__ = ["Alpha", "AsyncAlpha"]
  14. class Alpha(SyncAPIResource):
  15. @cached_property
  16. def graders(self) -> Graders:
  17. return Graders(self._client)
  18. @cached_property
  19. def with_raw_response(self) -> AlphaWithRawResponse:
  20. """
  21. This property can be used as a prefix for any HTTP method call to return
  22. the raw response object instead of the parsed content.
  23. For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
  24. """
  25. return AlphaWithRawResponse(self)
  26. @cached_property
  27. def with_streaming_response(self) -> AlphaWithStreamingResponse:
  28. """
  29. An alternative to `.with_raw_response` that doesn't eagerly read the response body.
  30. For more information, see https://www.github.com/openai/openai-python#with_streaming_response
  31. """
  32. return AlphaWithStreamingResponse(self)
  33. class AsyncAlpha(AsyncAPIResource):
  34. @cached_property
  35. def graders(self) -> AsyncGraders:
  36. return AsyncGraders(self._client)
  37. @cached_property
  38. def with_raw_response(self) -> AsyncAlphaWithRawResponse:
  39. """
  40. This property can be used as a prefix for any HTTP method call to return
  41. the raw response object instead of the parsed content.
  42. For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
  43. """
  44. return AsyncAlphaWithRawResponse(self)
  45. @cached_property
  46. def with_streaming_response(self) -> AsyncAlphaWithStreamingResponse:
  47. """
  48. An alternative to `.with_raw_response` that doesn't eagerly read the response body.
  49. For more information, see https://www.github.com/openai/openai-python#with_streaming_response
  50. """
  51. return AsyncAlphaWithStreamingResponse(self)
  52. class AlphaWithRawResponse:
  53. def __init__(self, alpha: Alpha) -> None:
  54. self._alpha = alpha
  55. @cached_property
  56. def graders(self) -> GradersWithRawResponse:
  57. return GradersWithRawResponse(self._alpha.graders)
  58. class AsyncAlphaWithRawResponse:
  59. def __init__(self, alpha: AsyncAlpha) -> None:
  60. self._alpha = alpha
  61. @cached_property
  62. def graders(self) -> AsyncGradersWithRawResponse:
  63. return AsyncGradersWithRawResponse(self._alpha.graders)
  64. class AlphaWithStreamingResponse:
  65. def __init__(self, alpha: Alpha) -> None:
  66. self._alpha = alpha
  67. @cached_property
  68. def graders(self) -> GradersWithStreamingResponse:
  69. return GradersWithStreamingResponse(self._alpha.graders)
  70. class AsyncAlphaWithStreamingResponse:
  71. def __init__(self, alpha: AsyncAlpha) -> None:
  72. self._alpha = alpha
  73. @cached_property
  74. def graders(self) -> AsyncGradersWithStreamingResponse:
  75. return AsyncGradersWithStreamingResponse(self._alpha.graders)