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
18 changes: 9 additions & 9 deletions flo_ai/factory/agent_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ def create(session: FloSession, agent: AgentConfig):
if agent_kind is None:
raise FloException(f"""Unknown agent kind: `{kind}`. The supported types are llm, tool, reflection, delegator or agentic.
Check the documentation @ {DOCUMENTATION_AGENT_ANCHOR}""")
match agent_kind:
case AgentKinds.llm:
return AgentFactory.__create_llm_agent(session, agent)
case AgentKinds.tool:
return AgentFactory.__create_runnable_agent(session, agent)
case AgentKinds.reflection:
return AgentFactory.__create_reflection_agent(session, agent)
case AgentKinds.delegator:
return AgentFactory.__create_delegator_agent(session, agent)
if agent_kind == AgentKinds.llm:
return AgentFactory.__create_llm_agent(session, agent)
elif agent_kind == AgentKinds.tool:
return AgentFactory.__create_runnable_agent(session, agent)
elif agent_kind == AgentKinds.reflection:
return AgentFactory.__create_reflection_agent(session, agent)
elif agent_kind == AgentKinds.delegator:
return AgentFactory.__create_delegator_agent(session, agent)

return AgentFactory.__create_agentic_agent(session, agent, tool_map)

@staticmethod
Expand Down
9 changes: 1 addition & 8 deletions flo_ai/models/flo_executable.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@ class ExecutableType(Enum):

@staticmethod
def isAgent(type: 'ExecutableType'):
match type:
case ExecutableType.agentic:
return True
case ExecutableType.llm:
return True
case ExecutableType.tool:
return True
return False
return type in [ExecutableType.agentic, ExecutableType.llm, ExecutableType.tool]


class ExecutableFlo(FloMember):
Expand Down
4 changes: 2 additions & 2 deletions flo_ai/router/flo_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def add_delegation_edge(
workflow: StateGraph,
parent: FloNode,
delegation_node: FloNode,
nextNode: Union[FloNode | str],
nextNode: Union[FloNode, str],
):
to_agent_names = delegation_node.delegate.to
delegation_node_name = delegation_node.name
Expand Down Expand Up @@ -129,7 +129,7 @@ def add_reflection_edge(
self,
workflow: StateGraph,
reflection_node: FloNode,
nextNode: Union[FloNode | str],
nextNode: Union[FloNode, str],
):
to_agent_name = reflection_node.delegate.to[0]
retry = reflection_node.delegate.retry or 1
Expand Down
2 changes: 1 addition & 1 deletion flo_ai/yaml/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class PromptStrategy(BaseModel):
kind: str
agent_name: str
retries: int
next: str | None = None
next: Union[str, None] = None


class MemberKey(BaseModel):
Expand Down
3,143 changes: 744 additions & 2,399 deletions poetry.lock

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
[tool.poetry]
name = "flo-ai"
version = "0.0.5-dev5"
version = "0.0.5-dev7"
description = "A easy way to create structured AI agents"
authors = ["vizsatiz <vishnu@rootfor.xyz>"]
license = "MIT"
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.10,<4.0"
python = ">=3.9,<4.0"
langchain = "0.3.3"
langgraph = "0.2.38"
ipython = "8.24.0"
httpx = "0.27.0"
pillow = "^10.3.0"
pydantic = "^2.9.2"
Expand All @@ -19,7 +18,7 @@ langchain-community = "0.3.2"

[tool.poetry.group.dev.dependencies]
langchain-mongodb = "^0.2.0"
langchain-chroma = "^0.1.4"
# langchain-chroma = "^0.1.4"
langchainhub = "^0.1.17"
pypdf = "^4.2.0"
ipykernel = "^6.29.5"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='flo-ai',
version='0.0.5-dev5',
version='0.0.5-dev7',
author='Rootflo',
description='Create composable AI agents',
long_description=long_description,
Expand Down