Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create POC for simplifications #785

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
10 changes: 5 additions & 5 deletions inference/core/entities/responses/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ def from_internal_entity(
nested_operation_input_kind, nested_operation_output_kind = None, None
if operation_description.nested_operation_input_kind:
nested_operation_input_kind = [
k.name for k in operation_description.nested_operation_input_kind
k for k in operation_description.nested_operation_input_kind
]
if operation_description.nested_operation_output_kind:
nested_operation_output_kind = [
k.name for k in operation_description.nested_operation_output_kind
k for k in operation_description.nested_operation_output_kind
]
return cls(
operation_type=operation_description.operation_type,
compound=operation_description.compound,
input_kind=[k.name for k in operation_description.input_kind],
output_kind=[k.name for k in operation_description.output_kind],
input_kind=[k for k in operation_description.input_kind],
output_kind=[k for k in operation_description.output_kind],
nested_operation_input_kind=nested_operation_input_kind,
nested_operation_output_kind=nested_operation_output_kind,
description=operation_description.description,
Expand All @@ -95,7 +95,7 @@ def from_internal_entity(
cls, operator_description: OperatorDescription
) -> "ExternalOperatorDescription":
operands_kinds = [
[k.name for k in kind] for kind in operator_description.operands_kinds
[k for k in kind] for kind in operator_description.operands_kinds
]
return cls(
operator_type=operator_description.operator_type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
class OperationDescription(BaseModel):
operation_type: str
compound: bool
input_kind: List[Kind]
output_kind: List[Kind]
nested_operation_input_kind: Optional[List[Kind]] = None
nested_operation_output_kind: Optional[List[Kind]] = None
input_kind: List[str]
output_kind: List[str]
nested_operation_input_kind: Optional[List[str]] = None
nested_operation_output_kind: Optional[List[str]] = None
description: Optional[str] = None


class OperatorDescription(BaseModel):
operator_type: str
operands_number: int
operands_kinds: List[List[Kind]]
operands_kinds: List[List[str]]
description: Optional[str] = None
Loading
Loading