diff --git a/src/agents/react_agent/agent.py b/src/agents/react_agent/agent.py index d5cf4d1..caa4fd5 100644 --- a/src/agents/react_agent/agent.py +++ b/src/agents/react_agent/agent.py @@ -35,11 +35,11 @@ async def call_model( # Initialize the model with tool binding. Change the model or add more tools here. try: - model = load_chat_model("openai/gpt-4-turbo-preview").bind_tools(TOOLS) + model = load_chat_model("openai/gpt-4o").bind_tools(TOOLS) except ValueError as e: print(f"Error loading model: {e}") # Fallback to a default model if the configured one fails - model = load_chat_model("openai/gpt-4").bind_tools(TOOLS) + model = load_chat_model("openai/gpt-4o").bind_tools(TOOLS) # Format the system prompt. Customize this to change the agent's behavior. system_message = configuration.system_prompt.format( diff --git a/src/agents/react_agent/tools.py b/src/agents/react_agent/tools.py index 8f961f9..13496b1 100644 --- a/src/agents/react_agent/tools.py +++ b/src/agents/react_agent/tools.py @@ -16,6 +16,7 @@ from composio_langgraph import Action, ComposioToolSet, App from .configuration import Configuration +import pdb composio_toolset = ComposioToolSet( auth = { @@ -24,11 +25,12 @@ } ) -composio_tools = composio_toolset.get_tools( - apps=[App.GMAIL, App.TRELLO] -) - -print(composio_tools) +gmail = composio_toolset.get_tools(apps=[App.GMAIL]) +calendar = composio_toolset.get_tools(apps=[App.GOOGLECALENDAR]) +linear = composio_toolset.get_tools(apps=[App.LINEAR]) +trello = composio_toolset.get_tools(apps=[App.TRELLO]) +twitter = composio_toolset.get_tools(apps=[App.TWITTER]) +# pdb.set_trace() async def search( query: str, *, config: Annotated[RunnableConfig, InjectedToolArg] @@ -46,4 +48,4 @@ async def search( # Combine the search tool with Composio tools using spread operator -TOOLS: List[Callable[..., Any]] = [search, *composio_tools] +TOOLS: List[Callable[..., Any]] = [search, *gmail, *calendar, *linear, *trello, *twitter] diff --git a/src/assets/assista_logo_grey.png b/src/assets/assista_logo_grey.png new file mode 100644 index 0000000..9308715 Binary files /dev/null and b/src/assets/assista_logo_grey.png differ diff --git a/src/streamlit_app.py b/src/streamlit_app.py index 417bc72..46eaefd 100644 --- a/src/streamlit_app.py +++ b/src/streamlit_app.py @@ -23,16 +23,23 @@ # The app heavily uses AgentClient to interact with the agent's FastAPI endpoints. -APP_TITLE = "Agent Service Toolkit" -APP_ICON = "🧰" +APP_TITLE = "Assista Ai Agent" +# Define the path to your PNG file (remove this if not needed) +# PNG_PATH = os.path.join("src", "assets", "assista_logo_grey.png") async def main() -> None: st.set_page_config( page_title=APP_TITLE, - page_icon=APP_ICON, + page_icon=None, # Remove the page icon menu_items={}, ) + + # Set the page icon in the browser tab (remove this if not needed) + # st.markdown( + # f'', + # unsafe_allow_html=True + # ) # Hide the streamlit upper-right chrome st.html( @@ -83,9 +90,9 @@ async def main() -> None: # Config options with st.sidebar: - st.header(f"{APP_ICON} {APP_TITLE}") + st.header(APP_TITLE) # Render the title without the image "" - "Full toolkit for running an AI agent service built with LangGraph, FastAPI and Streamlit" + "Empower Your Workflow Like Never Before With Assista Ai" with st.popover(":material/settings: Settings", use_container_width=True): model_idx = agent_client.info.models.index(agent_client.info.default_model) model = st.selectbox("LLM to use", options=agent_client.info.models, index=model_idx) @@ -98,50 +105,50 @@ async def main() -> None: ) use_streaming = st.toggle("Stream results", value=True) - @st.dialog("Architecture") - def architecture_dialog() -> None: - st.image( - "https://github.com/JoshuaC215/agent-service-toolkit/blob/main/media/agent_architecture.png?raw=true" - ) - "[View full size on Github](https://github.com/JoshuaC215/agent-service-toolkit/blob/main/media/agent_architecture.png)" - st.caption( - "App hosted on [Streamlit Cloud](https://share.streamlit.io/) with FastAPI service running in [Azure](https://learn.microsoft.com/en-us/azure/app-service/)" - ) - - if st.button(":material/schema: Architecture", use_container_width=True): - architecture_dialog() - - with st.popover(":material/policy: Privacy", use_container_width=True): - st.write( - "Prompts, responses and feedback in this app are anonymously recorded and saved to LangSmith for product evaluation and improvement purposes only." - ) - - @st.dialog("Share/resume chat") - def share_chat_dialog() -> None: - session = st.runtime.get_instance()._session_mgr.list_active_sessions()[0] - st_base_url = urllib.parse.urlunparse( - [session.client.request.protocol, session.client.request.host, "", "", "", ""] - ) - # if it's not localhost, switch to https by default - if not st_base_url.startswith("https") and "localhost" not in st_base_url: - st_base_url = st_base_url.replace("http", "https") - chat_url = f"{st_base_url}?thread_id={st.session_state.thread_id}" - st.markdown(f"**Chat URL:**\n```text\n{chat_url}\n```") - st.info("Copy the above URL to share or revisit this chat") - - if st.button(":material/upload: Share/resume chat", use_container_width=True): - share_chat_dialog() - - "[View the source code](https://github.com/JoshuaC215/agent-service-toolkit)" - st.caption( - "Made with :material/favorite: by [Joshua](https://www.linkedin.com/in/joshua-k-carroll/) in Oakland" - ) + # @st.dialog("Architecture") + # def architecture_dialog() -> None: + # st.image( + # "https://github.com/JoshuaC215/agent-service-toolkit/blob/main/media/agent_architecture.png?raw=true" + # ) + # "[View full size on Github](https://github.com/JoshuaC215/agent-service-toolkit/blob/main/media/agent_architecture.png)" + # st.caption( + # "App hosted on [Streamlit Cloud](https://share.streamlit.io/) with FastAPI service running in [Azure](https://learn.microsoft.com/en-us/azure/app-service/)" + # ) + + # if st.button(":material/schema: Architecture", use_container_width=True): + # architecture_dialog() + + # with st.popover(":material/policy: Privacy", use_container_width=True): + # st.write( + # "Prompts, responses and feedback in this app are anonymously recorded and saved to LangSmith for product evaluation and improvement purposes only." + # ) + + # @st.dialog("Share/resume chat") + # def share_chat_dialog() -> None: + # session = st.runtime.get_instance()._session_mgr.list_active_sessions()[0] + # st_base_url = urllib.parse.urlunparse( + # [session.client.request.protocol, session.client.request.host, "", "", "", ""] + # ) + # # if it's not localhost, switch to https by default + # if not st_base_url.startswith("https") and "localhost" not in st_base_url: + # st_base_url = st_base_url.replace("http", "https") + # chat_url = f"{st_base_url}?thread_id={st.session_state.thread_id}" + # st.markdown(f"**Chat URL:**\n```text\n{chat_url}\n```") + # st.info("Copy the above URL to share or revisit this chat") + + # if st.button(":material/upload: Share/resume chat", use_container_width=True): + # share_chat_dialog() + + # "[View the source code](https://github.com/JoshuaC215/agent-service-toolkit)" + # st.caption( + # "Made with :material/favorite: by [Joshua](https://www.linkedin.com/in/joshua-k-carroll/) in Oakland" + # ) # Draw existing messages messages: list[ChatMessage] = st.session_state.messages if len(messages) == 0: - WELCOME = "Hello! I'm an AI-powered research assistant with web search and a calculator. Ask me anything!" + WELCOME = "Hello! I'm an AI-powered assistant with web search and a lot of tools. Ask me anything!" with st.chat_message("ai"): st.write(WELCOME)