-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/workflow-backend' into deploy/dev
- Loading branch information
Showing
13 changed files
with
237 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,9 @@ | ||
from enum import Enum | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel | ||
|
||
from core.workflow.entities.base_node_data_entities import BaseNodeData | ||
from core.workflow.entities.variable_entities import VariableSelector | ||
|
||
|
||
class EndNodeOutputType(Enum): | ||
""" | ||
END Node Output Types. | ||
none, plain-text, structured | ||
""" | ||
NONE = 'none' | ||
PLAIN_TEXT = 'plain-text' | ||
STRUCTURED = 'structured' | ||
|
||
@classmethod | ||
def value_of(cls, value: str) -> 'OutputType': | ||
""" | ||
Get value of given output type. | ||
:param value: output type value | ||
:return: output type | ||
""" | ||
for output_type in cls: | ||
if output_type.value == value: | ||
return output_type | ||
raise ValueError(f'invalid output type value {value}') | ||
|
||
|
||
class EndNodeDataOutputs(BaseModel): | ||
""" | ||
END Node Data Outputs. | ||
""" | ||
class OutputType(Enum): | ||
""" | ||
Output Types. | ||
""" | ||
NONE = 'none' | ||
PLAIN_TEXT = 'plain-text' | ||
STRUCTURED = 'structured' | ||
|
||
@classmethod | ||
def value_of(cls, value: str) -> 'OutputType': | ||
""" | ||
Get value of given output type. | ||
:param value: output type value | ||
:return: output type | ||
""" | ||
for output_type in cls: | ||
if output_type.value == value: | ||
return output_type | ||
raise ValueError(f'invalid output type value {value}') | ||
|
||
type: OutputType = OutputType.NONE | ||
plain_text_selector: Optional[list[str]] = None | ||
structured_variables: Optional[list[VariableSelector]] = None | ||
|
||
|
||
class EndNodeData(BaseNodeData): | ||
""" | ||
END Node Data. | ||
""" | ||
outputs: Optional[EndNodeDataOutputs] = None | ||
outputs: list[VariableSelector] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.