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:
ogabrielluiz 2024-06-10 11:39:40 -03:00
commit 2ab49133fa
2 changed files with 0 additions and 45 deletions

View file

@ -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)

View file

@ -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)