From cb75dd8b5dc8a9ce59be8a7a2fcd9730826c9285 Mon Sep 17 00:00:00 2001 From: vizsatiz Date: Sun, 17 Nov 2024 19:36:42 +0530 Subject: [PATCH 1/2] Doc changes for 0.0.4 release --- CONTRIBUTING.md | 2 ++ README.md | 2 +- ROADMAP.md | 13 ++++++------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b9ea1bcd..6b34e688 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,6 +6,7 @@ Fork the repository. Create a new branch for your feature. Add your feature or improvement. Send a pull request. + We appreciate your input! ## Installing Dependencies @@ -13,4 +14,5 @@ We appreciate your input! ```cmd poetry lock poetry install +pre-commit install ``` diff --git a/README.md b/README.md index 3533fb6a..b7fa9e5d 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ for response in flo.stream("Write about recent AI developments"): ``` **Note:** You can make each of the above agents including the router to different models, giving flexibility to combine the power of different LLMs. -To know more, check multi-model integration in detailed [documentation](https://flo-ai.rootflo.ai) +To know more, check multi-model integration in detailed [documentation](https://flo-ai.rootflo.ai/advanced/model-switching) ### Lets Create a AI team using code diff --git a/ROADMAP.md b/ROADMAP.md index 636e9343..e5fc8189 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -8,13 +8,7 @@ Core features improve the library itself to cater wider range of functionalities | Name | Description | Status | Release version | |------|-------------|--------|-----------------| -| Full composability | Right now teams can only be combined with teams and agents with agents. We want to extend this to team + agent composibility | ✅ | 0.0.4 | -| Error handling | Ability to handle errors autonomously | ✅ | 0.0.4| -|LLM Extensibilty| Ability to different LLMs across different agents and teams| ✅ | 0.0.4| -|Async Tools| Ability create tools easily within asyncio | ✅ | 0.0.4| -|Observer| Observer framework for raising agent decision events and other important events | ✅ | 0.0.4| |Output formatter| Ability to templatize output format using pydantic| Yet to start| 0.0.4| -|Auto-Query RAG| Ability to make metadata query within the agentic, which can automatically add metadata while rag query runs, like timestamp or other data|Yet to start|TBD| |Parellel Router| A router to execute tasks or agents in parallel if the tasks are independent | Yet to start | TBD ## Observability @@ -24,7 +18,6 @@ These features improve logging and debugging abilities while building. | Name | Description | Status | Release version | |------|-------------|--------|-----------------| |Recursion control| Expose parameters like recursion control to limit recursions and policy in case of recursion etc | Yet to start | 0.0.5 -|Set up tests| Create a framework for unit-testing flo-ai and its internal functionalities| ✅ | 0.0.4 ## Community @@ -47,6 +40,12 @@ The community is welcome to suggest changes to the roadmap, through a pull reque |Reflection| Reflection lets you build a component that can make the AI retrospectively look at the current output and retry or work again on the task at hand| ✅ | 0.0.3| |Delegator| Delegator lets you build a component that can help delegate a flo to a particular agent, by some condition| ✅ | 0.0.3| |Logging Framework|Better logging framework which can be extended to parent application (with log level control)| ✅|0.0.3| +| Full composability | Right now teams can only be combined with teams and agents with agents. We want to extend this to team + agent composibility | ✅ | 0.0.4 | +| Error handling | Ability to handle errors autonomously | ✅ | 0.0.4| +|LLM Extensibilty| Ability to different LLMs across different agents and teams| ✅ | 0.0.4| +|Async Tools| Ability create tools easily within asyncio | ✅ | 0.0.4| +|Observer| Observer framework for raising agent decision events and other important events | ✅ | 0.0.4| +|Set up tests| Create a framework for unit-testing flo-ai and its internal functionalities| ✅ | 0.0.4 From 147b2a6f4281dae917e1ad397f4a57a05798858e Mon Sep 17 00:00:00 2001 From: vizsatiz Date: Mon, 18 Nov 2024 17:54:32 +0530 Subject: [PATCH 2/2] Fix to change flotool and flo_callback imports --- README.md | 2 +- examples/agent_of_flo_ai.ipynb | 2 +- examples/python/llm_extensibility.py | 2 +- examples/python/tool_error_handling.py | 2 +- flo_ai/__init__.py | 1 - flo_ai/callbacks/__init__.py | 13 +++++++++++++ flo_ai/{state => callbacks}/flo_callbacks.py | 0 flo_ai/common/flo_langchain_logger.py | 2 +- flo_ai/models/flo_node.py | 6 +++++- flo_ai/state/flo_session.py | 2 +- flo_ai/tools/__init__.py | 3 +++ 11 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 flo_ai/callbacks/__init__.py rename flo_ai/{state => callbacks}/flo_callbacks.py (100%) create mode 100644 flo_ai/tools/__init__.py diff --git a/README.md b/README.md index b7fa9e5d..f8ad9f06 100644 --- a/README.md +++ b/README.md @@ -203,7 +203,7 @@ Along with that FloAI has a decorator `@flotool` which makes any function into a Creating a simple tool using `@flotool`: ```python -from flo_ai import flotool +from flo_ai.tools import flotool from pydantic import BaseModel, Field # define argument schema diff --git a/examples/agent_of_flo_ai.ipynb b/examples/agent_of_flo_ai.ipynb index f5ee033e..db8c61d7 100644 --- a/examples/agent_of_flo_ai.ipynb +++ b/examples/agent_of_flo_ai.ipynb @@ -429,7 +429,7 @@ } ], "source": [ - "from flo_ai import flotool\n", + "from flo_ai.tools import flotool\n", "from langchain.tools import BaseTool\n", "\n", "@flotool(\"print_tool\", \"To print the state\")\n", diff --git a/examples/python/llm_extensibility.py b/examples/python/llm_extensibility.py index 2de0f2f5..0b6a7ad1 100644 --- a/examples/python/llm_extensibility.py +++ b/examples/python/llm_extensibility.py @@ -3,7 +3,7 @@ from pydantic import BaseModel, Field from langchain_openai import ChatOpenAI from flo_ai.tools.flo_tool import flotool -from flo_ai.state.flo_callbacks import flo_agent_callback, FloCallbackResponse +from flo_ai.callbacks.flo_callbacks import flo_agent_callback, FloCallbackResponse from dotenv import load_dotenv import warnings diff --git a/examples/python/tool_error_handling.py b/examples/python/tool_error_handling.py index ff857d85..2c4fa2b9 100644 --- a/examples/python/tool_error_handling.py +++ b/examples/python/tool_error_handling.py @@ -4,7 +4,7 @@ from pydantic import BaseModel, Field from typing import List from dotenv import load_dotenv -from flo_ai import flotool +from flo_ai.tools import flotool import asyncio load_dotenv() diff --git a/flo_ai/__init__.py b/flo_ai/__init__.py index d0b03af4..2ec5d57e 100644 --- a/flo_ai/__init__.py +++ b/flo_ai/__init__.py @@ -1,5 +1,4 @@ from flo_ai.core import Flo as Flo -from flo_ai.tools.flo_tool import flotool as flotool from flo_ai.models.flo_team import FloTeam as FloTeam from flo_ai.models.flo_agent import FloAgent as FloAgent from flo_ai.router.flo_linear import FloLinear as FloLinear diff --git a/flo_ai/callbacks/__init__.py b/flo_ai/callbacks/__init__.py new file mode 100644 index 00000000..69fba216 --- /dev/null +++ b/flo_ai/callbacks/__init__.py @@ -0,0 +1,13 @@ +from flo_ai.callbacks.flo_callbacks import ( + flo_agent_callback, + flo_router_callback, + flo_tool_callback, + flo_call_back, +) + +__all__ = [ + 'flo_agent_callback', + 'flo_router_callback', + 'flo_tool_callback', + 'flo_call_back', +] diff --git a/flo_ai/state/flo_callbacks.py b/flo_ai/callbacks/flo_callbacks.py similarity index 100% rename from flo_ai/state/flo_callbacks.py rename to flo_ai/callbacks/flo_callbacks.py diff --git a/flo_ai/common/flo_langchain_logger.py b/flo_ai/common/flo_langchain_logger.py index 6fc98441..216fd8ae 100644 --- a/flo_ai/common/flo_langchain_logger.py +++ b/flo_ai/common/flo_langchain_logger.py @@ -2,7 +2,7 @@ from langchain.callbacks.base import BaseCallbackHandler from langchain.schema import AgentAction, AgentFinish, LLMResult from flo_ai.common.flo_logger import get_logger -from flo_ai.state.flo_callbacks import FloToolCallback +from flo_ai.callbacks.flo_callbacks import FloToolCallback class FloLangchainLogger(BaseCallbackHandler): diff --git a/flo_ai/models/flo_node.py b/flo_ai/models/flo_node.py index 8971861b..6b3163d4 100644 --- a/flo_ai/models/flo_node.py +++ b/flo_ai/models/flo_node.py @@ -9,7 +9,11 @@ from flo_ai.models.flo_executable import ExecutableType from flo_ai.state.flo_session import FloSession from typing import Optional, Type, List -from flo_ai.state.flo_callbacks import FloAgentCallback, FloRouterCallback, FloCallback +from flo_ai.callbacks.flo_callbacks import ( + FloAgentCallback, + FloRouterCallback, + FloCallback, +) class FloNode: diff --git a/flo_ai/state/flo_session.py b/flo_ai/state/flo_session.py index 1985275d..82457fb0 100644 --- a/flo_ai/state/flo_session.py +++ b/flo_ai/state/flo_session.py @@ -5,7 +5,7 @@ from flo_ai.common.flo_logger import get_logger from flo_ai.common.flo_langchain_logger import FloLangchainLogger from flo_ai.helpers.utils import random_str -from flo_ai.state.flo_callbacks import ( +from flo_ai.callbacks.flo_callbacks import ( FloToolCallback, FloAgentCallback, FloRouterCallback, diff --git a/flo_ai/tools/__init__.py b/flo_ai/tools/__init__.py new file mode 100644 index 00000000..f7c55444 --- /dev/null +++ b/flo_ai/tools/__init__.py @@ -0,0 +1,3 @@ +from flo_ai.tools.flo_tool import flotool + +__all__ = ['flotool']