Skip to main content

An AI package for humans

Project description

Agenteasy

Agenteasy is an AI library designed to simplify the creation and management of AI applications for humans. It is incredibly easy to use and extend, reducing the burden typically associated with developing AI solutions.

The motivation behind creating Agenteasy stems from the complexity and difficulty of extending current AI tools available in the market. Many of these tools are either too complicated or challenging to customize for specific needs. Agenteasy aims to address these issues by providing a simplified, yet powerful foundation that can serve as the basis for more advanced AI functionality.

With Agenteasy, developers can utilize the ai_template syntax to define the templates for AI processes. This syntax uses a basic format: System:xxx||User:xxx||Assistant:xxx||. The keywords System, User, and Assistant signify different roles in the message flow, and they can appear in any order. ai_template parses the text between these keywords and the || to generate structured messages.

Features

Simplicity: Intuitive design and interface make it ideal for both beginners and experienced developers.

Extensibility: Easily extend the library to suit specific project needs.

Efficiency: Streamlines the process of building AI applications, allowing developers to focus on application logic rather than technical details.

Installation

To use the agenteasy library, you'll first need to install it. Assuming it is available on PyPI, you can install it via pip:

pip install agenteasy

Basic Usage Example

Let's walk through a simple example of how to use Agenteasy to translate language:

# Import the necessary modules from agenteasy
import agenteasy
from agenteasy.promptools import ai_template

# Define a template for the AI task
@ai_template
def plain_translate(*, content: str, target: str, source: str | None = None):
    """System: {% if source is defined %}Source Language: {{source}}{% endif %}
    Task: Translate the user provided content into {{target}}. Return the translation only.||
    User: {{content}}"""
    ...

# Initialize an AI Agent with a GPT model
agent = agenteasy.AIAgent(agenteasy.GPT())

# Generate a translation
print(
    agent.generate(
        messages=plain_translate(
            content="这是一个平凡的早晨",
            target="English",
        )
    )
)

Explanation

Define Translation Task: The @ai_template decorator is used to define the main task of translating a given piece of content into the target language. This utilizes the ai_template syntax for structured communication.

Create an AI Agent: The AIAgent is initialized with a language model (GPT in this case) to perform the operations.

Invoke the Translation: The generate method is called on the agent to execute the translation, printing the result.

Extending Agenteasy

The design of Agenteasy allows developers to build upon its core functionality. Create new templates or modify existing ones to fit the unique requirements of your application.

Contributing

Contributions to Agenteasy are welcome! If you encounter any issues or have suggestions for improvement, please create a pull request or open an issue on the project's GitHub repository.

License

Agenteasy is licensed under the GNU Lesser General Public License v3. Please see the LICENSE file for more information. This means Agenteasy can be freely used, modified, and redistributed in open source projects according to the terms of the LGPLv3.

Agenteasy makes building AI applications a breeze, empowering developers to focus on what matters most — creating intelligent, transformative solutions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agenteasy-0.1.1.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

agenteasy-0.1.1-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file agenteasy-0.1.1.tar.gz.

File metadata

  • Download URL: agenteasy-0.1.1.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for agenteasy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1452688642a6af3fea36af13671e55c171d13358846d69b19ce03606e1137af5
MD5 7bdd14e6c651f655f444cf02acfc58b6
BLAKE2b-256 bf043a52e801588bfabc684429886c7162a03e6b7a6e9bfca6d19c1cfc08e5cf

See more details on using hashes here.

File details

Details for the file agenteasy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: agenteasy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for agenteasy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1899833fdb07a0ef00ea4a1d2197966470830898c750978b8d49d3b74543287a
MD5 4233e8575612159dc0302bee57b90810
BLAKE2b-256 22b4ba8c899c41ea3b6a020f03fa75e7066723de7bd0e795348d533c3c69085c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page