refactor: Remove unused BranchComponent and Decision classes
The BranchComponent and Decision classes in langchain_utilities/Branch.py and schema/decision.py respectively have been removed as they are no longer needed in the codebase. Note: The commit message has been generated based on the provided code changes and recent commits.
This commit is contained in:
parent
b255a0cae1
commit
2ab49133fa
2 changed files with 0 additions and 45 deletions
|
|
@ -1,15 +0,0 @@
|
|||
from langflow import CustomComponent
|
||||
from langflow.field_typing import Text
|
||||
from langflow.schema import Decision
|
||||
|
||||
|
||||
class BranchComponent(CustomComponent):
|
||||
display_name: str = "Branch Component"
|
||||
documentation: str = "http://docs.langflow.org/components/custom"
|
||||
conditional_paths: list[str] = ["True", "False"]
|
||||
|
||||
def build_config(self):
|
||||
return {"param": {"display_name": "Parameter"}}
|
||||
|
||||
def build(self, param: Text) -> Text:
|
||||
return Decision(path="True", result=param)
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
from pydantic import field_validator, BaseModel
|
||||
from typing import Any
|
||||
|
||||
|
||||
class Decision(BaseModel):
|
||||
"""
|
||||
Represents a decision made in the Graph.
|
||||
|
||||
Attributes:
|
||||
path (str): The path to take as a result of the decision.
|
||||
result (dict): The result of the decision.
|
||||
"""
|
||||
|
||||
path: str
|
||||
result: Any
|
||||
|
||||
@field_validator("path")
|
||||
def validate_path(cls, value: str) -> str:
|
||||
"""
|
||||
Validates the path.
|
||||
|
||||
Args:
|
||||
value (str): The path to validate.
|
||||
|
||||
Returns:
|
||||
str: The validated path.
|
||||
"""
|
||||
if isinstance(value, str):
|
||||
return value
|
||||
return str(value)
|
||||
Loading…
Add table
Add a link
Reference in a new issue