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.2.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

agenteasy-0.1.2-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agenteasy-0.1.2.tar.gz
  • Upload date:
  • Size: 24.0 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.2.tar.gz
Algorithm Hash digest
SHA256 c320ac52a59e4ec8ccc5af40d08390a141ee6ca75ed743415eac0a8d69cf2654
MD5 159ab7fd53e779eb0dbcd89bde46cf71
BLAKE2b-256 1d2301ae771eae780fe73480aaeaac2c6793db3a5054a8c05e27c6b22ac18abb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agenteasy-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 22.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e9d1b7bb1bc6453a0587aac30ca6c7c8bb55c25811312b83b99602c362883101
MD5 ef8d33bf9545ba52ebeb94c5f1845f75
BLAKE2b-256 3bac30c7dbce89118d5b60d59ee3d6ecaebf0cedf242daefd2a37dea5c771013

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