Skip to content

Commit

Permalink
Refactor messages
Browse files Browse the repository at this point in the history
  • Loading branch information
davorrunje committed Oct 8, 2024
1 parent 3d471c7 commit 30ce804
Show file tree
Hide file tree
Showing 89 changed files with 780 additions and 385 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ import os
from autogen.agentchat import ConversableAgent

from fastagency import UI, FastAgency, Workflows
from fastagency.runtime.autogen.base import AutoGenWorkflows
from fastagency.runtimes.autogen import AutoGenWorkflows
from fastagency.ui.mesop import MesopUI
```

Expand Down
73 changes: 38 additions & 35 deletions docs/docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ search:
- Getting Started
- [Getting Started](getting-started/index.md)
- [User guide](user-guide/index.md)
- [Runtimes](user-guide/runtime/index.md)
- [AutoGen](user-guide/runtime/autogen/index.md)
- [Runtimes](user-guide/runtimes/index.md)
- [AutoGen](user-guide/runtimes/autogen/index.md)
- Agents
- [WebSurfer](user-guide/runtime/autogen/websurfer.md)
- [User interaction](user-guide/runtime/autogen/interactions.md)
- [CrewAI](user-guide/runtime/crewai/basics.md)
- [WebSurfer](user-guide/runtimes/autogen/websurfer.md)
- [User interaction](user-guide/runtimes/autogen/interactions.md)
- [CrewAI](user-guide/runtimes/crewai/basics.md)
- [UI](user-guide/ui/index.md)
- [Console](user-guide/ui/console/basics.md)
- [Mesop](user-guide/ui/mesop/basics.md)
Expand Down Expand Up @@ -75,22 +75,10 @@ search:
- base
- [ASGIProtocol](api/fastagency/base/ASGIProtocol.md)
- [AdapterProtocol](api/fastagency/base/AdapterProtocol.md)
- [AskingMessage](api/fastagency/base/AskingMessage.md)
- [Error](api/fastagency/base/Error.md)
- [FunctionCallExecution](api/fastagency/base/FunctionCallExecution.md)
- [IOMessage](api/fastagency/base/IOMessage.md)
- [IOMessageVisitor](api/fastagency/base/IOMessageVisitor.md)
- [KeepAlive](api/fastagency/base/KeepAlive.md)
- [MultipleChoice](api/fastagency/base/MultipleChoice.md)
- [ProviderProtocol](api/fastagency/base/ProviderProtocol.md)
- [Runnable](api/fastagency/base/Runnable.md)
- [SuggestedFunctionCall](api/fastagency/base/SuggestedFunctionCall.md)
- [SystemMessage](api/fastagency/base/SystemMessage.md)
- [TextInput](api/fastagency/base/TextInput.md)
- [TextMessage](api/fastagency/base/TextMessage.md)
- [UI](api/fastagency/base/UI.md)
- [WSGIProtocol](api/fastagency/base/WSGIProtocol.md)
- [WorkflowCompleted](api/fastagency/base/WorkflowCompleted.md)
- [WorkflowsProtocol](api/fastagency/base/WorkflowsProtocol.md)
- [run_workflow](api/fastagency/base/run_workflow.md)
- cli
Expand Down Expand Up @@ -123,34 +111,45 @@ search:
- [optional_temp_path](api/fastagency/helpers/optional_temp_path.md)
- logging
- [get_logger](api/fastagency/logging/get_logger.md)
- runtime
- messages
- [AskingMessage](api/fastagency/messages/AskingMessage.md)
- [Error](api/fastagency/messages/Error.md)
- [FunctionCallExecution](api/fastagency/messages/FunctionCallExecution.md)
- [IOMessage](api/fastagency/messages/IOMessage.md)
- [KeepAlive](api/fastagency/messages/KeepAlive.md)
- [MessageProcessorMixin](api/fastagency/messages/MessageProcessorMixin.md)
- [MessageProcessorProtocol](api/fastagency/messages/MessageProcessorProtocol.md)
- [MultipleChoice](api/fastagency/messages/MultipleChoice.md)
- [SuggestedFunctionCall](api/fastagency/messages/SuggestedFunctionCall.md)
- [SystemMessage](api/fastagency/messages/SystemMessage.md)
- [TextInput](api/fastagency/messages/TextInput.md)
- [TextMessage](api/fastagency/messages/TextMessage.md)
- [WorkflowCompleted](api/fastagency/messages/WorkflowCompleted.md)
- [WorkflowStarted](api/fastagency/messages/WorkflowStarted.md)
- runtimes
- autogen
- [AutoGenWorkflows](api/fastagency/runtime/autogen/AutoGenWorkflows.md)
- [IOStreamAdapter](api/fastagency/runtime/autogen/IOStreamAdapter.md)
- [AutoGenWorkflows](api/fastagency/runtimes/autogen/AutoGenWorkflows.md)
- [IOStreamAdapter](api/fastagency/runtimes/autogen/IOStreamAdapter.md)
- agents
- websurfer
- [WebSurferAgent](api/fastagency/runtime/autogen/agents/websurfer/WebSurferAgent.md)
- base
- [AutoGenWorkflows](api/fastagency/runtime/autogen/base/AutoGenWorkflows.md)
- [CurrentMessage](api/fastagency/runtime/autogen/base/CurrentMessage.md)
- [IOStreamAdapter](api/fastagency/runtime/autogen/base/IOStreamAdapter.md)
- [Toolable](api/fastagency/runtime/autogen/base/Toolable.md)
- [WebSurferAgent](api/fastagency/runtimes/autogen/agents/websurfer/WebSurferAgent.md)
- autogen
- [AutoGenWorkflows](api/fastagency/runtimes/autogen/autogen/AutoGenWorkflows.md)
- [CurrentMessage](api/fastagency/runtimes/autogen/autogen/CurrentMessage.md)
- [IOStreamAdapter](api/fastagency/runtimes/autogen/autogen/IOStreamAdapter.md)
- [Toolable](api/fastagency/runtimes/autogen/autogen/Toolable.md)
- tools
- [WebSurferTool](api/fastagency/runtime/autogen/tools/WebSurferTool.md)
- [WebSurferTool](api/fastagency/runtimes/autogen/tools/WebSurferTool.md)
- web_surfer
- [WebSurferAnswer](api/fastagency/runtime/autogen/tools/web_surfer/WebSurferAnswer.md)
- [WebSurferTool](api/fastagency/runtime/autogen/tools/web_surfer/WebSurferTool.md)
- [WebSurferAnswer](api/fastagency/runtimes/autogen/tools/web_surfer/WebSurferAnswer.md)
- [WebSurferTool](api/fastagency/runtimes/autogen/tools/web_surfer/WebSurferTool.md)
- ui
- console
- [ConsoleUI](api/fastagency/ui/console/ConsoleUI.md)
- base
- [ConsoleUI](api/fastagency/ui/console/base/ConsoleUI.md)
- console
- [ConsoleUI](api/fastagency/ui/console/console/ConsoleUI.md)
- mesop
- [MesopUI](api/fastagency/ui/mesop/MesopUI.md)
- base
- [MesopMessage](api/fastagency/ui/mesop/base/MesopMessage.md)
- [MesopUI](api/fastagency/ui/mesop/base/MesopUI.md)
- [run_workflow](api/fastagency/ui/mesop/base/run_workflow.md)
- components
- helpers
- [darken_hex_color](api/fastagency/ui/mesop/components/helpers/darken_hex_color.md)
Expand All @@ -164,6 +163,10 @@ search:
- [MesopHomePage](api/fastagency/ui/mesop/main/MesopHomePage.md)
- [MesopHomePageParams](api/fastagency/ui/mesop/main/MesopHomePageParams.md)
- [create_home_page](api/fastagency/ui/mesop/main/create_home_page.md)
- mesop
- [MesopMessage](api/fastagency/ui/mesop/mesop/MesopMessage.md)
- [MesopUI](api/fastagency/ui/mesop/mesop/MesopUI.md)
- [run_workflow](api/fastagency/ui/mesop/mesop/run_workflow.md)
- message
- [MesopGUIMessageVisitor](api/fastagency/ui/mesop/message/MesopGUIMessageVisitor.md)
- [consume_responses](api/fastagency/ui/mesop/message/consume_responses.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.base.AskingMessage
::: fastagency.messages.AskingMessage
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.base.Error
::: fastagency.messages.Error
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.base.FunctionCallExecution
::: fastagency.messages.FunctionCallExecution
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.base.IOMessage
::: fastagency.messages.IOMessage
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.base.KeepAlive
::: fastagency.messages.KeepAlive
11 changes: 11 additions & 0 deletions docs/docs/en/api/fastagency/messages/MessageProcessorMixin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# 0.5 - API
# 2 - Release
# 3 - Contributing
# 5 - Template Page
# 10 - Default
search:
boost: 0.5
---

::: fastagency.messages.MessageProcessorMixin
11 changes: 11 additions & 0 deletions docs/docs/en/api/fastagency/messages/MessageProcessorProtocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# 0.5 - API
# 2 - Release
# 3 - Contributing
# 5 - Template Page
# 10 - Default
search:
boost: 0.5
---

::: fastagency.messages.MessageProcessorProtocol
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.base.MultipleChoice
::: fastagency.messages.MultipleChoice
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.base.SuggestedFunctionCall
::: fastagency.messages.SuggestedFunctionCall
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.base.SystemMessage
::: fastagency.messages.SystemMessage
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.base.TextInput
::: fastagency.messages.TextInput
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.base.TextMessage
::: fastagency.messages.TextMessage
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.base.WorkflowCompleted
::: fastagency.messages.WorkflowCompleted
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.base.IOMessageVisitor
::: fastagency.messages.WorkflowStarted
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.runtime.autogen.AutoGenWorkflows
::: fastagency.runtimes.autogen.AutoGenWorkflows
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.runtime.autogen.IOStreamAdapter
::: fastagency.runtimes.autogen.IOStreamAdapter
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.runtime.autogen.agents.websurfer.WebSurferAgent
::: fastagency.runtimes.autogen.agents.websurfer.WebSurferAgent
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.runtime.autogen.base.AutoGenWorkflows
::: fastagency.runtimes.autogen.autogen.AutoGenWorkflows
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.runtime.autogen.base.CurrentMessage
::: fastagency.runtimes.autogen.autogen.CurrentMessage
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.runtime.autogen.base.IOStreamAdapter
::: fastagency.runtimes.autogen.autogen.IOStreamAdapter
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.runtime.autogen.base.Toolable
::: fastagency.runtimes.autogen.autogen.Toolable
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.runtime.autogen.tools.WebSurferTool
::: fastagency.runtimes.autogen.tools.WebSurferTool
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.runtime.autogen.tools.web_surfer.WebSurferAnswer
::: fastagency.runtimes.autogen.tools.web_surfer.WebSurferAnswer
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.runtime.autogen.tools.web_surfer.WebSurferTool
::: fastagency.runtimes.autogen.tools.web_surfer.WebSurferTool
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.ui.console.base.ConsoleUI
::: fastagency.ui.console.console.ConsoleUI
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.ui.mesop.base.MesopMessage
::: fastagency.ui.mesop.mesop.MesopMessage
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.ui.mesop.base.MesopUI
::: fastagency.ui.mesop.mesop.MesopUI
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ search:
boost: 0.5
---

::: fastagency.ui.mesop.base.run_workflow
::: fastagency.ui.mesop.mesop.run_workflow
2 changes: 1 addition & 1 deletion docs/docs/en/tutorial/giphy/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ This is a core function used by the **GiphyAgent** to either present the task re
### Creating the Giphy and WebSurfer Agents

- **GiphyAgent**: A ***ConversableAgent*** is created with the name "Giphy_Agent". It uses the system message defined earlier and relies on the termination function to end the chat when needed.
- **WebSurferAgent**: The ***WebSurferAgent*** is responsible for scraping web content and passes the retrieved data to the **GiphyAgent**. It’s configured with a summarizer to condense web content, which is useful when presenting concise data to the user. For more information, visit [**WebSurfer User Guide**](../../user-guide/runtime/autogen/websurfer){target="_blank"}.
- **WebSurferAgent**: The ***WebSurferAgent*** is responsible for scraping web content and passes the retrieved data to the **GiphyAgent**. It’s configured with a summarizer to condense web content, which is useful when presenting concise data to the user. For more information, visit [**WebSurfer User Guide**](../../user-guide/runtimes/autogen/websurfer){target="_blank"}.

```python
{! docs_src/tutorial/giphy/main.py [ln:79-93] !}
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/en/user-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Whether you're orchestrating complex AI agents or integrating external APIs into

## Key Features

- [**Multi-Runtime Support**](runtime/): FastAgency supports multiple agentic [runtimes](runtime/) to provide maximum flexibility. Currently, it supports **AutoGen** and plans to extend support to [CrewAI](https://www.crewai.com/){target="_blank"}. This ensures that as the AI ecosystem evolves, FastAgency remains a reliable and adaptable framework, capable of leveraging emerging agentic technologies. Developers can easily switch between frameworks, choosing the best one for their project's specific needs.
- [**Multi-Runtime Support**](runtimes/): FastAgency supports multiple agentic [runtimes](runtimes/) to provide maximum flexibility. Currently, it supports **AutoGen** and plans to extend support to [CrewAI](https://www.crewai.com/){target="_blank"}. This ensures that as the AI ecosystem evolves, FastAgency remains a reliable and adaptable framework, capable of leveraging emerging agentic technologies. Developers can easily switch between frameworks, choosing the best one for their project's specific needs.

- [**Unified Programming Interface Across UIs**](ui/): FastAgency features a **common programming interface** that enables you to develop your core workflows once and reuse them across various user interfaces without rewriting code. This includes support for both **console-based applications** via `ConsoleUI` and **web-based applications** via `MesopUI`. Whether you need a command-line tool or a fully interactive web app, FastAgency allows you to deploy the same underlying workflows across environments, saving development time and ensuring consistency.

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/docs/en/user-guide/ui/console/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ We begin by importing the necessary modules from **FastAgency** and **AutoGen**.
- **ConversableAgent**: This class allows the creation of agents that can engage in conversational tasks.
- **[FastAgency](../../../../api/fastagency/FastAgency/)**: The core class responsible for orchestrating workflows and connecting them with UIs.
- **[UI](../../../../api/fastagency/UI/)** and **[ConsoleUI](../../../../api/fastagency/ui/console/ConsoleUI/)**: These classes define the user interface for interaction, with ConsoleUI providing a text-based interface.
- **[AutoGenWorkflows](../../../../api/fastagency/runtime/autogen/base/AutoGenWorkflows/)**: Manages the creation and execution of multi-agent workflows.
- **[AutoGenWorkflows](../../../../api/fastagency/runtimes/autogen/base/AutoGenWorkflows/)**: Manages the creation and execution of multi-agent workflows.

#### 2. **Configure the Language Model (LLM)**
Next, we configure the language model that will power the agents. In this case, we're using **GPT-4o**, and the API key is retrieved from the environment.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/en/user-guide/ui/mesop/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ We begin by importing the necessary modules from **FastAgency** and **AutoGen**.
- **ConversableAgent**: This class allows the creation of agents that can engage in conversational tasks.
- **[FastAgency](../../../../api/fastagency/FastAgency/)**: The core class responsible for orchestrating workflows and connecting them with UIs.
- **[UI](../../../../api/fastagency/UI/)** and **[MesopUI](../../../../api/fastagency/ui/mesop/MesopUI/)**: These classes define the user interface for interaction, with **MesopUI** enabling a web-based interaction.
- **[AutoGenWorkflows](../../../../api/fastagency/runtime/autogen/base/AutoGenWorkflows/)**: Manages the creation and execution of multi-agent workflows.
- **[AutoGenWorkflows](../../../../api/fastagency/runtimes/autogen/base/AutoGenWorkflows/)**: Manages the creation and execution of multi-agent workflows.

#### 2. **Configure the Language Model (LLM)**
Next, we configure the language model that powers the agents. In this case, we're using **GPT-4o**, and the API key is retrieved from the environment.
Expand Down
10 changes: 5 additions & 5 deletions docs/docs/navigation_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ search:
- Getting Started
- [Getting Started](getting-started/index.md)
- [User guide](user-guide/index.md)
- [Runtimes](user-guide/runtime/index.md)
- [AutoGen](user-guide/runtime/autogen/index.md)
- [Runtimes](user-guide/runtimes/index.md)
- [AutoGen](user-guide/runtimes/autogen/index.md)
- Agents
- [WebSurfer](user-guide/runtime/autogen/websurfer.md)
- [User interaction](user-guide/runtime/autogen/interactions.md)
- [CrewAI](user-guide/runtime/crewai/basics.md)
- [WebSurfer](user-guide/runtimes/autogen/websurfer.md)
- [User interaction](user-guide/runtimes/autogen/interactions.md)
- [CrewAI](user-guide/runtimes/crewai/basics.md)
- [UI](user-guide/ui/index.md)
- [Console](user-guide/ui/console/basics.md)
- [Mesop](user-guide/ui/mesop/basics.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs_src/getting_started/main_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from autogen.agentchat import ConversableAgent

from fastagency import UI, FastAgency, WorkflowsProtocol
from fastagency.runtime.autogen import AutoGenWorkflows
from fastagency.runtimes.autogen import AutoGenWorkflows
from fastagency.ui.console import ConsoleUI

llm_config = {
Expand Down
2 changes: 1 addition & 1 deletion docs/docs_src/getting_started/main_mesop.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from autogen.agentchat import ConversableAgent

from fastagency import UI, FastAgency, WorkflowsProtocol
from fastagency.runtime.autogen import AutoGenWorkflows
from fastagency.runtimes.autogen import AutoGenWorkflows
from fastagency.ui.mesop import MesopUI

llm_config = {
Expand Down
7 changes: 3 additions & 4 deletions docs/docs_src/tutorial/giphy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
from fastagency import UI, FastAgency, WorkflowsProtocol
from fastagency.api.openapi.client import OpenAPI
from fastagency.api.openapi.security import APIKeyQuery
from fastagency.base import TextInput
from fastagency.runtime.autogen.agents.websurfer import WebSurferAgent
from fastagency.runtime.autogen.base import AutoGenWorkflows
from fastagency.messages import TextInput
from fastagency.runtimes.autogen.agents.websurfer import WebSurferAgent
from fastagency.runtimes.autogen.autogen import AutoGenWorkflows
from fastagency.ui.mesop import MesopUI


llm_config = {
"config_list": [
{
Expand Down
Loading

0 comments on commit 30ce804

Please sign in to comment.