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

Uploaded Source

Built Distribution

agenteasy-0.1.0-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for agenteasy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2f14c2ab622d7d053ee1f8ee7c2565bd01650448a6e9c47c79b50c48b552dfdb
MD5 90bd3ef960dc5038290a5d8ce0c52415
BLAKE2b-256 8ef37fb25dfd025d426ece5da4238bb835011c8074af0166316e46c9454c55fd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for agenteasy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77960324a56b93bb6b1b7c2832e0c6f258e2ef12a4a5c5fb08e941bdcd73e32c
MD5 cbfae4473f77df5a7d595d6a5d1bcad5
BLAKE2b-256 450d07a02632ce72d0280496290a34c8ac1ecc82de7c1c1f329e8c1deb4075ac

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