Make SubFox production-ready with parallel translation and UI controls
This commit is contained in:
parent
c40b8bed2b
commit
2b1d05f02c
6046 changed files with 798327 additions and 0 deletions
|
|
@ -0,0 +1,33 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .alpha import (
|
||||
Alpha,
|
||||
AsyncAlpha,
|
||||
AlphaWithRawResponse,
|
||||
AsyncAlphaWithRawResponse,
|
||||
AlphaWithStreamingResponse,
|
||||
AsyncAlphaWithStreamingResponse,
|
||||
)
|
||||
from .graders import (
|
||||
Graders,
|
||||
AsyncGraders,
|
||||
GradersWithRawResponse,
|
||||
AsyncGradersWithRawResponse,
|
||||
GradersWithStreamingResponse,
|
||||
AsyncGradersWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"Graders",
|
||||
"AsyncGraders",
|
||||
"GradersWithRawResponse",
|
||||
"AsyncGradersWithRawResponse",
|
||||
"GradersWithStreamingResponse",
|
||||
"AsyncGradersWithStreamingResponse",
|
||||
"Alpha",
|
||||
"AsyncAlpha",
|
||||
"AlphaWithRawResponse",
|
||||
"AsyncAlphaWithRawResponse",
|
||||
"AlphaWithStreamingResponse",
|
||||
"AsyncAlphaWithStreamingResponse",
|
||||
]
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,108 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .graders import (
|
||||
Graders,
|
||||
AsyncGraders,
|
||||
GradersWithRawResponse,
|
||||
AsyncGradersWithRawResponse,
|
||||
GradersWithStreamingResponse,
|
||||
AsyncGradersWithStreamingResponse,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
|
||||
__all__ = ["Alpha", "AsyncAlpha"]
|
||||
|
||||
|
||||
class Alpha(SyncAPIResource):
|
||||
@cached_property
|
||||
def graders(self) -> Graders:
|
||||
"""Manage fine-tuning jobs to tailor a model to your specific training data."""
|
||||
return Graders(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AlphaWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AlphaWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AlphaWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
|
||||
"""
|
||||
return AlphaWithStreamingResponse(self)
|
||||
|
||||
|
||||
class AsyncAlpha(AsyncAPIResource):
|
||||
@cached_property
|
||||
def graders(self) -> AsyncGraders:
|
||||
"""Manage fine-tuning jobs to tailor a model to your specific training data."""
|
||||
return AsyncGraders(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncAlphaWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncAlphaWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncAlphaWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
|
||||
"""
|
||||
return AsyncAlphaWithStreamingResponse(self)
|
||||
|
||||
|
||||
class AlphaWithRawResponse:
|
||||
def __init__(self, alpha: Alpha) -> None:
|
||||
self._alpha = alpha
|
||||
|
||||
@cached_property
|
||||
def graders(self) -> GradersWithRawResponse:
|
||||
"""Manage fine-tuning jobs to tailor a model to your specific training data."""
|
||||
return GradersWithRawResponse(self._alpha.graders)
|
||||
|
||||
|
||||
class AsyncAlphaWithRawResponse:
|
||||
def __init__(self, alpha: AsyncAlpha) -> None:
|
||||
self._alpha = alpha
|
||||
|
||||
@cached_property
|
||||
def graders(self) -> AsyncGradersWithRawResponse:
|
||||
"""Manage fine-tuning jobs to tailor a model to your specific training data."""
|
||||
return AsyncGradersWithRawResponse(self._alpha.graders)
|
||||
|
||||
|
||||
class AlphaWithStreamingResponse:
|
||||
def __init__(self, alpha: Alpha) -> None:
|
||||
self._alpha = alpha
|
||||
|
||||
@cached_property
|
||||
def graders(self) -> GradersWithStreamingResponse:
|
||||
"""Manage fine-tuning jobs to tailor a model to your specific training data."""
|
||||
return GradersWithStreamingResponse(self._alpha.graders)
|
||||
|
||||
|
||||
class AsyncAlphaWithStreamingResponse:
|
||||
def __init__(self, alpha: AsyncAlpha) -> None:
|
||||
self._alpha = alpha
|
||||
|
||||
@cached_property
|
||||
def graders(self) -> AsyncGradersWithStreamingResponse:
|
||||
"""Manage fine-tuning jobs to tailor a model to your specific training data."""
|
||||
return AsyncGradersWithStreamingResponse(self._alpha.graders)
|
||||
|
|
@ -0,0 +1,286 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import httpx
|
||||
|
||||
from .... import _legacy_response
|
||||
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
||||
from ...._utils import maybe_transform, async_maybe_transform
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
|
||||
from ...._base_client import make_request_options
|
||||
from ....types.fine_tuning.alpha import grader_run_params, grader_validate_params
|
||||
from ....types.fine_tuning.alpha.grader_run_response import GraderRunResponse
|
||||
from ....types.fine_tuning.alpha.grader_validate_response import GraderValidateResponse
|
||||
|
||||
__all__ = ["Graders", "AsyncGraders"]
|
||||
|
||||
|
||||
class Graders(SyncAPIResource):
|
||||
"""Manage fine-tuning jobs to tailor a model to your specific training data."""
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> GradersWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return GradersWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> GradersWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
|
||||
"""
|
||||
return GradersWithStreamingResponse(self)
|
||||
|
||||
def run(
|
||||
self,
|
||||
*,
|
||||
grader: grader_run_params.Grader,
|
||||
model_sample: str,
|
||||
item: object | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> GraderRunResponse:
|
||||
"""
|
||||
Run a grader.
|
||||
|
||||
Args:
|
||||
grader: The grader used for the fine-tuning job.
|
||||
|
||||
model_sample: The model sample to be evaluated. This value will be used to populate the
|
||||
`sample` namespace. See
|
||||
[the guide](https://platform.openai.com/docs/guides/graders) for more details.
|
||||
The `output_json` variable will be populated if the model sample is a valid JSON
|
||||
string.
|
||||
|
||||
item: The dataset item provided to the grader. This will be used to populate the
|
||||
`item` namespace. See
|
||||
[the guide](https://platform.openai.com/docs/guides/graders) for more details.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
return self._post(
|
||||
"/fine_tuning/alpha/graders/run",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"grader": grader,
|
||||
"model_sample": model_sample,
|
||||
"item": item,
|
||||
},
|
||||
grader_run_params.GraderRunParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=GraderRunResponse,
|
||||
)
|
||||
|
||||
def validate(
|
||||
self,
|
||||
*,
|
||||
grader: grader_validate_params.Grader,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> GraderValidateResponse:
|
||||
"""
|
||||
Validate a grader.
|
||||
|
||||
Args:
|
||||
grader: The grader used for the fine-tuning job.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
return self._post(
|
||||
"/fine_tuning/alpha/graders/validate",
|
||||
body=maybe_transform({"grader": grader}, grader_validate_params.GraderValidateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=GraderValidateResponse,
|
||||
)
|
||||
|
||||
|
||||
class AsyncGraders(AsyncAPIResource):
|
||||
"""Manage fine-tuning jobs to tailor a model to your specific training data."""
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncGradersWithRawResponse:
|
||||
"""
|
||||
This property can be used as a prefix for any HTTP method call to return
|
||||
the raw response object instead of the parsed content.
|
||||
|
||||
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
|
||||
"""
|
||||
return AsyncGradersWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncGradersWithStreamingResponse:
|
||||
"""
|
||||
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
||||
|
||||
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
|
||||
"""
|
||||
return AsyncGradersWithStreamingResponse(self)
|
||||
|
||||
async def run(
|
||||
self,
|
||||
*,
|
||||
grader: grader_run_params.Grader,
|
||||
model_sample: str,
|
||||
item: object | Omit = omit,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> GraderRunResponse:
|
||||
"""
|
||||
Run a grader.
|
||||
|
||||
Args:
|
||||
grader: The grader used for the fine-tuning job.
|
||||
|
||||
model_sample: The model sample to be evaluated. This value will be used to populate the
|
||||
`sample` namespace. See
|
||||
[the guide](https://platform.openai.com/docs/guides/graders) for more details.
|
||||
The `output_json` variable will be populated if the model sample is a valid JSON
|
||||
string.
|
||||
|
||||
item: The dataset item provided to the grader. This will be used to populate the
|
||||
`item` namespace. See
|
||||
[the guide](https://platform.openai.com/docs/guides/graders) for more details.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
return await self._post(
|
||||
"/fine_tuning/alpha/graders/run",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"grader": grader,
|
||||
"model_sample": model_sample,
|
||||
"item": item,
|
||||
},
|
||||
grader_run_params.GraderRunParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=GraderRunResponse,
|
||||
)
|
||||
|
||||
async def validate(
|
||||
self,
|
||||
*,
|
||||
grader: grader_validate_params.Grader,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
||||
) -> GraderValidateResponse:
|
||||
"""
|
||||
Validate a grader.
|
||||
|
||||
Args:
|
||||
grader: The grader used for the fine-tuning job.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
return await self._post(
|
||||
"/fine_tuning/alpha/graders/validate",
|
||||
body=await async_maybe_transform({"grader": grader}, grader_validate_params.GraderValidateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=GraderValidateResponse,
|
||||
)
|
||||
|
||||
|
||||
class GradersWithRawResponse:
|
||||
def __init__(self, graders: Graders) -> None:
|
||||
self._graders = graders
|
||||
|
||||
self.run = _legacy_response.to_raw_response_wrapper(
|
||||
graders.run,
|
||||
)
|
||||
self.validate = _legacy_response.to_raw_response_wrapper(
|
||||
graders.validate,
|
||||
)
|
||||
|
||||
|
||||
class AsyncGradersWithRawResponse:
|
||||
def __init__(self, graders: AsyncGraders) -> None:
|
||||
self._graders = graders
|
||||
|
||||
self.run = _legacy_response.async_to_raw_response_wrapper(
|
||||
graders.run,
|
||||
)
|
||||
self.validate = _legacy_response.async_to_raw_response_wrapper(
|
||||
graders.validate,
|
||||
)
|
||||
|
||||
|
||||
class GradersWithStreamingResponse:
|
||||
def __init__(self, graders: Graders) -> None:
|
||||
self._graders = graders
|
||||
|
||||
self.run = to_streamed_response_wrapper(
|
||||
graders.run,
|
||||
)
|
||||
self.validate = to_streamed_response_wrapper(
|
||||
graders.validate,
|
||||
)
|
||||
|
||||
|
||||
class AsyncGradersWithStreamingResponse:
|
||||
def __init__(self, graders: AsyncGraders) -> None:
|
||||
self._graders = graders
|
||||
|
||||
self.run = async_to_streamed_response_wrapper(
|
||||
graders.run,
|
||||
)
|
||||
self.validate = async_to_streamed_response_wrapper(
|
||||
graders.validate,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue