Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 9 additions & 8 deletions guardrails-api-client/guardrails_api_client/models/rail_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,22 @@ class RailSpec:

Attributes:
output_schema (Schema):
prompt (str):
version (RailSpecVersion): Default: RailSpecVersion.VALUE_0.
input_schema (Union[Unset, Schema]):
instructions (Union[Unset, str]):
prompt (Union[Unset, str]):
"""

output_schema: "Schema"
prompt: str
version: RailSpecVersion = RailSpecVersion.VALUE_0
input_schema: Union[Unset, "Schema"] = UNSET
instructions: Union[Unset, str] = UNSET
prompt: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:
output_schema = self.output_schema.to_dict()

prompt = self.prompt

version = self.version.value

input_schema: Union[Unset, Dict[str, Any]] = UNSET
Expand All @@ -45,19 +43,22 @@ def to_dict(self) -> Dict[str, Any]:

instructions = self.instructions

prompt = self.prompt

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"outputSchema": output_schema,
"prompt": prompt,
"version": version,
}
)
if input_schema is not UNSET:
field_dict["inputSchema"] = input_schema
if instructions is not UNSET:
field_dict["instructions"] = instructions
if prompt is not UNSET:
field_dict["prompt"] = prompt

return field_dict

Expand All @@ -68,8 +69,6 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
output_schema = Schema.from_dict(d.pop("outputSchema"))

prompt = d.pop("prompt")

version = RailSpecVersion(d.pop("version"))

_input_schema = d.pop("inputSchema", UNSET)
Expand All @@ -81,12 +80,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:

instructions = d.pop("instructions", UNSET)

prompt = d.pop("prompt", UNSET)

rail_spec = cls(
output_schema=output_schema,
prompt=prompt,
version=version,
input_schema=input_schema,
instructions=instructions,
prompt=prompt,
)

rail_spec.additional_properties = d
Expand Down
1 change: 0 additions & 1 deletion open-api-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,6 @@ components:
- "0.1"
required:
- outputSchema
- prompt
- version
Schema:
type: object
Expand Down
1 change: 0 additions & 1 deletion service-specs/guardrails-service-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ components:
- "0.1"
required:
- outputSchema
- prompt
- version
Schema:
type: object
Expand Down