Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.http_validation_error import HTTPValidationError
from ...models.refine_spec_api_output import RefineSpecApiOutput
from ...models.refine_spec_input import RefineSpecInput
from ...models.refine_spec_output import RefineSpecOutput
from ...types import Response


Expand All @@ -32,9 +32,9 @@ def _get_kwargs(

def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> HTTPValidationError | RefineSpecOutput | None:
) -> HTTPValidationError | RefineSpecApiOutput | None:
if response.status_code == 200:
response_200 = RefineSpecOutput.from_dict(response.json())
response_200 = RefineSpecApiOutput.from_dict(response.json())

return response_200

Expand All @@ -51,7 +51,7 @@ def _parse_response(

def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[HTTPValidationError | RefineSpecOutput]:
) -> Response[HTTPValidationError | RefineSpecApiOutput]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -64,7 +64,7 @@ def sync_detailed(
*,
client: AuthenticatedClient,
body: RefineSpecInput,
) -> Response[HTTPValidationError | RefineSpecOutput]:
) -> Response[HTTPValidationError | RefineSpecApiOutput]:
"""Refine Spec

Refine a specification.
Expand All @@ -77,7 +77,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[HTTPValidationError | RefineSpecOutput]
Response[HTTPValidationError | RefineSpecApiOutput]
"""

kwargs = _get_kwargs(
Expand All @@ -95,7 +95,7 @@ def sync(
*,
client: AuthenticatedClient,
body: RefineSpecInput,
) -> HTTPValidationError | RefineSpecOutput | None:
) -> HTTPValidationError | RefineSpecApiOutput | None:
"""Refine Spec

Refine a specification.
Expand All @@ -108,7 +108,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
HTTPValidationError | RefineSpecOutput
HTTPValidationError | RefineSpecApiOutput
"""

return sync_detailed(
Expand All @@ -121,7 +121,7 @@ async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: RefineSpecInput,
) -> Response[HTTPValidationError | RefineSpecOutput]:
) -> Response[HTTPValidationError | RefineSpecApiOutput]:
"""Refine Spec

Refine a specification.
Expand All @@ -134,7 +134,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[HTTPValidationError | RefineSpecOutput]
Response[HTTPValidationError | RefineSpecApiOutput]
"""

kwargs = _get_kwargs(
Expand All @@ -150,7 +150,7 @@ async def asyncio(
*,
client: AuthenticatedClient,
body: RefineSpecInput,
) -> HTTPValidationError | RefineSpecOutput | None:
) -> HTTPValidationError | RefineSpecApiOutput | None:
"""Refine Spec

Refine a specification.
Expand All @@ -163,7 +163,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
HTTPValidationError | RefineSpecOutput
HTTPValidationError | RefineSpecApiOutput
"""

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.http_validation_error import HTTPValidationError
from ...models.refine_spec_output import RefineSpecOutput
from ...models.refine_spec_api_output import RefineSpecApiOutput
from ...models.submit_answers_request import SubmitAnswersRequest
from ...types import Response

Expand All @@ -32,9 +32,9 @@ def _get_kwargs(

def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> HTTPValidationError | RefineSpecOutput | None:
) -> HTTPValidationError | RefineSpecApiOutput | None:
if response.status_code == 200:
response_200 = RefineSpecOutput.from_dict(response.json())
response_200 = RefineSpecApiOutput.from_dict(response.json())

return response_200

Expand All @@ -51,7 +51,7 @@ def _parse_response(

def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[HTTPValidationError | RefineSpecOutput]:
) -> Response[HTTPValidationError | RefineSpecApiOutput]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -64,7 +64,7 @@ def sync_detailed(
*,
client: AuthenticatedClient,
body: SubmitAnswersRequest,
) -> Response[HTTPValidationError | RefineSpecOutput]:
) -> Response[HTTPValidationError | RefineSpecApiOutput]:
"""Refine Spec With Answers

Refine a specification with answers.
Expand All @@ -77,7 +77,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[HTTPValidationError | RefineSpecOutput]
Response[HTTPValidationError | RefineSpecApiOutput]
"""

kwargs = _get_kwargs(
Expand All @@ -95,7 +95,7 @@ def sync(
*,
client: AuthenticatedClient,
body: SubmitAnswersRequest,
) -> HTTPValidationError | RefineSpecOutput | None:
) -> HTTPValidationError | RefineSpecApiOutput | None:
"""Refine Spec With Answers

Refine a specification with answers.
Expand All @@ -108,7 +108,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
HTTPValidationError | RefineSpecOutput
HTTPValidationError | RefineSpecApiOutput
"""

return sync_detailed(
Expand All @@ -121,7 +121,7 @@ async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: SubmitAnswersRequest,
) -> Response[HTTPValidationError | RefineSpecOutput]:
) -> Response[HTTPValidationError | RefineSpecApiOutput]:
"""Refine Spec With Answers

Refine a specification with answers.
Expand All @@ -134,7 +134,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[HTTPValidationError | RefineSpecOutput]
Response[HTTPValidationError | RefineSpecApiOutput]
"""

kwargs = _get_kwargs(
Expand All @@ -150,7 +150,7 @@ async def asyncio(
*,
client: AuthenticatedClient,
body: SubmitAnswersRequest,
) -> HTTPValidationError | RefineSpecOutput | None:
) -> HTTPValidationError | RefineSpecApiOutput | None:
"""Refine Spec With Answers

Refine a specification with answers.
Expand All @@ -163,7 +163,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
HTTPValidationError | RefineSpecOutput
HTTPValidationError | RefineSpecApiOutput
"""

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@
from .job_status_response import JobStatusResponse
from .job_type import JobType
from .model_provider_name import ModelProviderName
from .new_proposed_spec_edit import NewProposedSpecEdit
from .new_proposed_spec_edit_api import NewProposedSpecEditApi
from .output_file_info import OutputFileInfo
from .prompt_generation_result import PromptGenerationResult
from .question import Question
from .question_set import QuestionSet
from .question_with_answer import QuestionWithAnswer
from .refine_spec_api_output import RefineSpecApiOutput
from .refine_spec_input import RefineSpecInput
from .refine_spec_output import RefineSpecOutput
from .sample import Sample
from .sample_job_output import SampleJobOutput
from .sample_job_result_response import SampleJobResultResponse
Expand All @@ -44,6 +43,10 @@
from .specification_input_spec_field_current_values import SpecificationInputSpecFieldCurrentValues
from .specification_input_spec_fields import SpecificationInputSpecFields
from .submit_answers_request import SubmitAnswersRequest
from .synthetic_data_generation_session_config import SyntheticDataGenerationSessionConfig
from .synthetic_data_generation_session_config_input import SyntheticDataGenerationSessionConfigInput
from .synthetic_data_generation_step_config import SyntheticDataGenerationStepConfig
from .synthetic_data_generation_step_config_input import SyntheticDataGenerationStepConfigInput
from .task_info import TaskInfo
from .task_metadata import TaskMetadata
from .validation_error import ValidationError
Expand Down Expand Up @@ -72,14 +75,13 @@
"JobStatusResponse",
"JobType",
"ModelProviderName",
"NewProposedSpecEdit",
"NewProposedSpecEditApi",
"OutputFileInfo",
"PromptGenerationResult",
"Question",
"QuestionSet",
"QuestionWithAnswer",
"RefineSpecApiOutput",
"RefineSpecInput",
"RefineSpecOutput",
"Sample",
"SampleJobOutput",
"SampleJobResultResponse",
Expand All @@ -91,6 +93,10 @@
"SpecSpecFieldCurrentValues",
"SpecSpecFields",
"SubmitAnswersRequest",
"SyntheticDataGenerationSessionConfig",
"SyntheticDataGenerationSessionConfigInput",
"SyntheticDataGenerationStepConfig",
"SyntheticDataGenerationStepConfigInput",
"TaskInfo",
"TaskMetadata",
"ValidationError",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

if TYPE_CHECKING:
from ..models.examples_for_feedback_item import ExamplesForFeedbackItem
from ..models.prompt_generation_result import PromptGenerationResult
from ..models.synthetic_data_generation_session_config import SyntheticDataGenerationSessionConfig
from ..models.synthetic_data_generation_step_config import SyntheticDataGenerationStepConfig


T = TypeVar("T", bound="ClarifySpecOutput")
Expand All @@ -19,15 +20,13 @@ class ClarifySpecOutput:
"""
Attributes:
examples_for_feedback (list[ExamplesForFeedbackItem]):
judge_result (PromptGenerationResult): Information about a prompt generation run.
topic_generation_result (PromptGenerationResult): Information about a prompt generation run.
input_generation_result (PromptGenerationResult): Information about a prompt generation run.
judge_result (SyntheticDataGenerationStepConfig): Configuration for a synthetic data generation step.
sdg_session_config (SyntheticDataGenerationSessionConfig): Configuration for a synthetic data generation session
"""

examples_for_feedback: list[ExamplesForFeedbackItem]
judge_result: PromptGenerationResult
topic_generation_result: PromptGenerationResult
input_generation_result: PromptGenerationResult
judge_result: SyntheticDataGenerationStepConfig
sdg_session_config: SyntheticDataGenerationSessionConfig
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:
Expand All @@ -38,18 +37,15 @@ def to_dict(self) -> dict[str, Any]:

judge_result = self.judge_result.to_dict()

topic_generation_result = self.topic_generation_result.to_dict()

input_generation_result = self.input_generation_result.to_dict()
sdg_session_config = self.sdg_session_config.to_dict()

field_dict: dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"examples_for_feedback": examples_for_feedback,
"judge_result": judge_result,
"topic_generation_result": topic_generation_result,
"input_generation_result": input_generation_result,
"sdg_session_config": sdg_session_config,
}
)

Expand All @@ -58,7 +54,8 @@ def to_dict(self) -> dict[str, Any]:
@classmethod
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
from ..models.examples_for_feedback_item import ExamplesForFeedbackItem
from ..models.prompt_generation_result import PromptGenerationResult
from ..models.synthetic_data_generation_session_config import SyntheticDataGenerationSessionConfig
from ..models.synthetic_data_generation_step_config import SyntheticDataGenerationStepConfig

d = dict(src_dict)
examples_for_feedback = []
Expand All @@ -68,17 +65,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:

examples_for_feedback.append(examples_for_feedback_item)

judge_result = PromptGenerationResult.from_dict(d.pop("judge_result"))

topic_generation_result = PromptGenerationResult.from_dict(d.pop("topic_generation_result"))
judge_result = SyntheticDataGenerationStepConfig.from_dict(d.pop("judge_result"))

input_generation_result = PromptGenerationResult.from_dict(d.pop("input_generation_result"))
sdg_session_config = SyntheticDataGenerationSessionConfig.from_dict(d.pop("sdg_session_config"))

clarify_spec_output = cls(
examples_for_feedback=examples_for_feedback,
judge_result=judge_result,
topic_generation_result=topic_generation_result,
input_generation_result=input_generation_result,
sdg_session_config=sdg_session_config,
)

clarify_spec_output.additional_properties = d
Expand Down
Loading
Loading