Metadata-Version: 2.3
Name: fastagency
Version: 0.3.0.dev2
Summary: The fastest way to bring multi-agent workflows to production
Project-URL: Homepage, https://github.com/airtai/fastagency
Project-URL: Documentation, https://fastagency.ai/latest/
Project-URL: Tracker, https://github.com/airtai/fastagency/issues
Project-URL: Source, https://github.com/airtai/fastagency
Project-URL: Discord, https://discord.gg/kJjSGWrknU
Author-email: airt <info@airt.ai>
License-File: LICENSE
Keywords: AI,LLM,autogen,autonomous agents,multi-agent
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: AsyncIO
Classifier: Framework :: Pydantic
Classifier: Framework :: Pydantic :: 2
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Internet
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: typer>=0.9
Requires-Dist: typing-extensions<5,>=4.8.0
Provides-Extra: autogen
Requires-Dist: autogen[anthropic,together]<0.4,>=0.3.0; extra == 'autogen'
Requires-Dist: flaml<2.3.0,==2.2.0; extra == 'autogen'
Requires-Dist: markdownify==0.13.1; extra == 'autogen'
Requires-Dist: together==1.2.11; extra == 'autogen'
Provides-Extra: dev
Requires-Dist: asyncer==0.0.8; extra == 'dev'
Requires-Dist: autogen[anthropic,together]<0.4,>=0.3.0; extra == 'dev'
Requires-Dist: bandit==1.7.10; extra == 'dev'
Requires-Dist: cairosvg==2.7.1; extra == 'dev'
Requires-Dist: codespell==2.3.0; extra == 'dev'
Requires-Dist: coverage[toml]==7.6.1; extra == 'dev'
Requires-Dist: detect-secrets==1.5.0; extra == 'dev'
Requires-Dist: dirty-equals==0.8.0; extra == 'dev'
Requires-Dist: email-validator==2.2.0; extra == 'dev'
Requires-Dist: fastapi-code-generator==0.5.1; extra == 'dev'
Requires-Dist: fastapi<1,>=0.112; extra == 'dev'
Requires-Dist: faststream[nats]<0.6,>=0.5.10; extra == 'dev'
Requires-Dist: flaml<2.3.0,==2.2.0; extra == 'dev'
Requires-Dist: gunicorn==23.0.0; extra == 'dev'
Requires-Dist: jsondiff==2.2.1; extra == 'dev'
Requires-Dist: markdownify==0.13.1; extra == 'dev'
Requires-Dist: mdx-include==1.4.2; extra == 'dev'
Requires-Dist: mesop<1,>=0.12.5; (python_version >= '3.10') and extra == 'dev'
Requires-Dist: mike==2.1.3; extra == 'dev'
Requires-Dist: mkdocs-autorefs==1.2.0; extra == 'dev'
Requires-Dist: mkdocs-git-revision-date-localized-plugin==1.2.9; extra == 'dev'
Requires-Dist: mkdocs-glightbox==0.4.0; extra == 'dev'
Requires-Dist: mkdocs-literate-nav==0.6.1; extra == 'dev'
Requires-Dist: mkdocs-macros-plugin==1.2.0; extra == 'dev'
Requires-Dist: mkdocs-material==9.5.39; extra == 'dev'
Requires-Dist: mkdocs-minify-plugin==0.8.0; extra == 'dev'
Requires-Dist: mkdocs-static-i18n==1.2.3; extra == 'dev'
Requires-Dist: mkdocs==1.6.1; extra == 'dev'
Requires-Dist: mkdocstrings[python]==0.26.1; extra == 'dev'
Requires-Dist: mypy==1.11.2; extra == 'dev'
Requires-Dist: pillow==10.4.0; extra == 'dev'
Requires-Dist: pre-commit==3.8.0; extra == 'dev'
Requires-Dist: pydantic-settings==2.5.2; extra == 'dev'
Requires-Dist: pytest-asyncio==0.24.0; extra == 'dev'
Requires-Dist: pytest-mypy-plugins==3.1.2; extra == 'dev'
Requires-Dist: pytest-rerunfailures==14.0; extra == 'dev'
Requires-Dist: pytest==8.3.3; extra == 'dev'
Requires-Dist: python-multipart>=0.0.12; extra == 'dev'
Requires-Dist: pyupgrade-directories==0.3.0; extra == 'dev'
Requires-Dist: pyyaml==6.0.2; extra == 'dev'
Requires-Dist: requests; extra == 'dev'
Requires-Dist: ruff==0.6.8; extra == 'dev'
Requires-Dist: semgrep==1.89.0; extra == 'dev'
Requires-Dist: together==1.2.11; extra == 'dev'
Requires-Dist: types-docutils; extra == 'dev'
Requires-Dist: types-pygments; extra == 'dev'
Requires-Dist: types-pyyaml; extra == 'dev'
Requires-Dist: types-setuptools; extra == 'dev'
Requires-Dist: types-ujson; extra == 'dev'
Requires-Dist: uvicorn==0.31.0; extra == 'dev'
Requires-Dist: watchfiles==0.24.0; extra == 'dev'
Requires-Dist: websockets<14,>=13; extra == 'dev'
Provides-Extra: devdocs
Requires-Dist: cairosvg==2.7.1; extra == 'devdocs'
Requires-Dist: mdx-include==1.4.2; extra == 'devdocs'
Requires-Dist: mike==2.1.3; extra == 'devdocs'
Requires-Dist: mkdocs-autorefs==1.2.0; extra == 'devdocs'
Requires-Dist: mkdocs-git-revision-date-localized-plugin==1.2.9; extra == 'devdocs'
Requires-Dist: mkdocs-glightbox==0.4.0; extra == 'devdocs'
Requires-Dist: mkdocs-literate-nav==0.6.1; extra == 'devdocs'
Requires-Dist: mkdocs-macros-plugin==1.2.0; extra == 'devdocs'
Requires-Dist: mkdocs-material==9.5.39; extra == 'devdocs'
Requires-Dist: mkdocs-minify-plugin==0.8.0; extra == 'devdocs'
Requires-Dist: mkdocs-static-i18n==1.2.3; extra == 'devdocs'
Requires-Dist: mkdocs==1.6.1; extra == 'devdocs'
Requires-Dist: mkdocstrings[python]==0.26.1; extra == 'devdocs'
Requires-Dist: pillow==10.4.0; extra == 'devdocs'
Provides-Extra: fastapi
Requires-Dist: asyncer==0.0.8; extra == 'fastapi'
Requires-Dist: fastapi<1,>=0.112; extra == 'fastapi'
Requires-Dist: faststream[nats]<0.6,>=0.5.10; extra == 'fastapi'
Requires-Dist: websockets<14,>=13; extra == 'fastapi'
Provides-Extra: lint
Requires-Dist: bandit==1.7.10; extra == 'lint'
Requires-Dist: codespell==2.3.0; extra == 'lint'
Requires-Dist: mypy==1.11.2; extra == 'lint'
Requires-Dist: pytest-mypy-plugins==3.1.2; extra == 'lint'
Requires-Dist: pyupgrade-directories==0.3.0; extra == 'lint'
Requires-Dist: ruff==0.6.8; extra == 'lint'
Requires-Dist: semgrep==1.89.0; extra == 'lint'
Requires-Dist: types-docutils; extra == 'lint'
Requires-Dist: types-pygments; extra == 'lint'
Requires-Dist: types-pyyaml; extra == 'lint'
Requires-Dist: types-setuptools; extra == 'lint'
Requires-Dist: types-ujson; extra == 'lint'
Provides-Extra: mesop
Requires-Dist: mesop<1,>=0.12.5; (python_version >= '3.10') and extra == 'mesop'
Provides-Extra: openapi
Requires-Dist: fastapi-code-generator==0.5.1; extra == 'openapi'
Requires-Dist: fastapi<1,>=0.112; extra == 'openapi'
Requires-Dist: requests; extra == 'openapi'
Provides-Extra: pyautogen
Requires-Dist: flaml<2.3.0,==2.2.0; extra == 'pyautogen'
Requires-Dist: markdownify==0.13.1; extra == 'pyautogen'
Requires-Dist: pyautogen[anthropic,together]<0.3,>=0.2.35; extra == 'pyautogen'
Requires-Dist: together>=1.2.11; extra == 'pyautogen'
Provides-Extra: server
Requires-Dist: gunicorn==23.0.0; extra == 'server'
Requires-Dist: uvicorn==0.31.0; extra == 'server'
Provides-Extra: submodules
Requires-Dist: asyncer==0.0.8; extra == 'submodules'
Requires-Dist: autogen[anthropic,together]<0.4,>=0.3.0; extra == 'submodules'
Requires-Dist: fastapi-code-generator==0.5.1; extra == 'submodules'
Requires-Dist: fastapi<1,>=0.112; extra == 'submodules'
Requires-Dist: faststream[nats]<0.6,>=0.5.10; extra == 'submodules'
Requires-Dist: flaml<2.3.0,==2.2.0; extra == 'submodules'
Requires-Dist: markdownify==0.13.1; extra == 'submodules'
Requires-Dist: mesop<1,>=0.12.5; (python_version >= '3.10') and extra == 'submodules'
Requires-Dist: requests; extra == 'submodules'
Requires-Dist: together==1.2.11; extra == 'submodules'
Requires-Dist: websockets<14,>=13; extra == 'submodules'
Provides-Extra: test-core
Requires-Dist: coverage[toml]==7.6.1; extra == 'test-core'
Requires-Dist: dirty-equals==0.8.0; extra == 'test-core'
Requires-Dist: jsondiff==2.2.1; extra == 'test-core'
Requires-Dist: pytest-asyncio==0.24.0; extra == 'test-core'
Requires-Dist: pytest-rerunfailures==14.0; extra == 'test-core'
Requires-Dist: pytest==8.3.3; extra == 'test-core'
Provides-Extra: testing
Requires-Dist: asyncer==0.0.8; extra == 'testing'
Requires-Dist: autogen[anthropic,together]<0.4,>=0.3.0; extra == 'testing'
Requires-Dist: coverage[toml]==7.6.1; extra == 'testing'
Requires-Dist: dirty-equals==0.8.0; extra == 'testing'
Requires-Dist: email-validator==2.2.0; extra == 'testing'
Requires-Dist: fastapi-code-generator==0.5.1; extra == 'testing'
Requires-Dist: fastapi<1,>=0.112; extra == 'testing'
Requires-Dist: faststream[nats]<0.6,>=0.5.10; extra == 'testing'
Requires-Dist: flaml<2.3.0,==2.2.0; extra == 'testing'
Requires-Dist: gunicorn==23.0.0; extra == 'testing'
Requires-Dist: jsondiff==2.2.1; extra == 'testing'
Requires-Dist: markdownify==0.13.1; extra == 'testing'
Requires-Dist: mesop<1,>=0.12.5; (python_version >= '3.10') and extra == 'testing'
Requires-Dist: pydantic-settings==2.5.2; extra == 'testing'
Requires-Dist: pytest-asyncio==0.24.0; extra == 'testing'
Requires-Dist: pytest-rerunfailures==14.0; extra == 'testing'
Requires-Dist: pytest==8.3.3; extra == 'testing'
Requires-Dist: python-multipart>=0.0.12; extra == 'testing'
Requires-Dist: pyyaml==6.0.2; extra == 'testing'
Requires-Dist: requests; extra == 'testing'
Requires-Dist: together==1.2.11; extra == 'testing'
Requires-Dist: uvicorn==0.31.0; extra == 'testing'
Requires-Dist: watchfiles==0.24.0; extra == 'testing'
Requires-Dist: websockets<14,>=13; extra == 'testing'
Description-Content-Type: text/markdown

![alt text](https://github.com/airtai/fastagency/blob/main/docs/docs/assets/img/FA-Secondary-LOGO.jpg?raw=true)


# FastAgency

<b>The fastest way to bring multi-agent workflows to production.</b>

---

<p align="center">
  <a href="https://github.com/airtai/fastagency/actions/workflows/pipeline.yaml" target="_blank">
    <img src="https://github.com/airtai/fastagency/actions/workflows/pipeline.yaml/badge.svg?branch=main" alt="Test Passing"/>
  </a>

  <a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/airtai/fastagency" target="_blank">
      <img src="https://coverage-badge.samuelcolvin.workers.dev/airtai/fastagency.svg" alt="Coverage">
  </a>

  <a href="https://www.pepy.tech/projects/fastagency" target="_blank">
    <img src="https://static.pepy.tech/personalized-badge/fastagency?period=month&units=international_system&left_color=grey&right_color=green&left_text=downloads/month" alt="Downloads"/>
  </a>

  <a href="https://pypi.org/project/fastagency" target="_blank">
    <img src="https://img.shields.io/pypi/v/fastagency?label=PyPI" alt="Package version">
  </a>

  <a href="https://pypi.org/project/fastagency" target="_blank">
    <img src="https://img.shields.io/pypi/pyversions/fastagency.svg" alt="Supported Python versions">
  </a>

  <br/>

  <a href="https://github.com/airtai/fastagency/actions/workflows/codeql.yml" target="_blank">
    <img src="https://github.com/airtai/fastagency/actions/workflows/codeql.yml/badge.svg" alt="CodeQL">
  </a>

  <a href="https://github.com/airtai/fastagency/actions/workflows/dependency-review.yaml" target="_blank">
    <img src="https://github.com/airtai/fastagency/actions/workflows/dependency-review.yaml/badge.svg" alt="Dependency Review">
  </a>

  <a href="https://github.com/airtai/fastagency/blob/main/LICENSE" target="_blank">
    <img src="https://img.shields.io/github/license/airtai/fastagency.png" alt="License">
  </a>

  <a href="https://github.com/airtai/fastagency/blob/main/CODE_OF_CONDUCT.md" target="_blank">
    <img src="https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg" alt="Code of Conduct">
  </a>

  <a href="https://discord.gg/kJjSGWrknU" target="_blank">
      <img alt="Discord" src="https://img.shields.io/discord/1247409549158121512?logo=discord">
  </a>
</p>

---

Welcome to FastAgency! This guide will walk you through the initial setup and usage of FastAgency, a powerful tool that leverages the AutoGen framework to quickly build applications. FastAgency is designed to be flexible and adaptable, and we plan to extend support to additional agentic frameworks such as [CrewAI](https://www.crewai.com/) in the near future. This will provide even more options for defining workflows and integrating with various AI tools.

With FastAgency, you can create interactive applications using various interfaces such as a console or Mesop.

## Supported Interfaces

FastAgency currently supports workflows defined using AutoGen and provides options for different types of applications:

- **Console**: Use the [ConsoleUI](https://fastagency.ai/0.2/api/fastagency/ui/console/ConsoleUI.md) interface for command-line based interaction. This is ideal for developing and testing workflows in a text-based environment.
- **Mesop**: Utilize [Mesop](https://google.github.io/mesop/) with [MesopUI](https://fastagency.ai/0.2/api/fastagency/ui/mesop/MesopUI.md) for web-based applications. This interface is suitable for creating web applications with a user-friendly interface.

We are also working on adding support for other frameworks, such as [CrewAI](https://www.crewai.com/), to broaden the scope and capabilities of FastAgency. Stay tuned for updates on these integrations.

## Quick start

### Install

To get started, you need to install FastAgency. You can do this using `pip`, Python's package installer. This command installs FastAgency with support for the [Mesop](https://google.github.io/mesop/) interface and AutoGen framework.

```console
pip install "fastagency[autogen,mesop]"
```

## Write Code

### Imports
Depending on the interface you choose, you'll need to import different modules. These imports set up the necessary components for your application:

```python
import os

from autogen.agentchat import ConversableAgent

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


### Define Workflow

You need to define the workflow that your application will use. This is where you specify how the agents interact and what they do. Here's a simple example of a workflow definition:

```python
llm_config = {
    "config_list": [
        {
            "model": "gpt-4o-mini",
            "api_key": os.getenv("OPENAI_API_KEY"),
        }
    ],
    "temperature": 0.0,
}

wf = AutoGenWorkflows()


@wf.register(name="simple_learning", description="Student and teacher learning chat")
def simple_workflow(
    wf: Workflows, ui: UI, initial_message: str, session_id: str
) -> str:
    student_agent = ConversableAgent(
        name="Student_Agent",
        system_message="You are a student willing to learn.",
        llm_config=llm_config,
    )
    teacher_agent = ConversableAgent(
        name="Teacher_Agent",
        system_message="You are a math teacher.",
        llm_config=llm_config,
    )

    chat_result = student_agent.initiate_chat(
        teacher_agent,
        message=initial_message,
        summary_method="reflection_with_llm",
        max_turns=3,
    )

    return chat_result.summary
```

This code snippet sets up a simple learning chat between a student and a teacher. You define the agents and how they should interact, specifying how the conversation should be summarized.

### Define FastAgency Application

Next, define your FastAgency application. This ties together your workflow and the interface you chose:

```python
app = FastAgency(wf=wf, ui=MesopUI(), title="Learning Chat")
```

## Run Application

Once everything is set up, you can run your FastAgency application using the following command:

  ```
  fastagency run
  ```

  However, the preferred way of running Mesop application is a Python WSGI HTTP Server such as [Gunicorn](https://gunicorn.org/). First,
  you need to install it using package manager such as `pip`:
  ```
  pip install gunicorn
  ```
  and then you can run it with:
  ```
  gunicorn main:app
  ```

### Output

  ```console
  [2024-10-01 16:18:59 +0000] [20390] [INFO] Starting gunicorn 23.0.0
  [2024-10-01 16:18:59 +0000] [20390] [INFO] Listening at: http://127.0.0.1:8000 (20390)
  [2024-10-01 16:18:59 +0000] [20390] [INFO] Using worker: sync
  [2024-10-01 16:18:59 +0000] [20391] [INFO] Booting worker with pid: 20391
  ```

  ![Initial message](https://fastagency.ai/0.2/getting-started/images/chat.png?v1)



## Future Plans

We are actively working on expanding FastAgency’s capabilities. In addition to supporting AutoGen, we plan to integrate support for other frameworks, such as [CrewAI](https://www.crewai.com/), to provide more flexibility and options for building applications. This will allow you to define workflows using a variety of frameworks and leverage their unique features and functionalities.

---

## Documentation

You can find detailed documentation on the following link: [fastagency.ai/latest](fastagency.ai/latest).

---

## Stay in touch

Please show your support and stay in touch by:

- giving our [GitHub repository](https://github.com/airtai/fastagency/) a star, and

- joining our [Discord server](https://discord.gg/kJjSGWrknU)

Your support helps us to stay in touch with you and encourages us to
continue developing and improving the framework. Thank you for your
support!

---

## Contributors

Thanks to all of these amazing people who made the project better!

<a href="https://github.com/airtai/fastagency/graphs/contributors" target="_blank">
  <img src="https://contrib.rocks/image?repo=airtai/fastagency"/>
</a>
