Skip to main content

A python package for setting up agentic behavior for LLMs. Includes optimization for large training data, and adherence to applied interactional policies.

Project description

AgenPy 0.1.2 📦

Python ChatGPT

A python package for setting up agentic behavior for LLMs. Includes optimization for large training data, and adherence to applied interactional policies.

Table Of Contents

Features

AgenPy is particularly useful for creating multi-modal agents using LLMs and other AI tools.

  • Set Behavior & Actions:
    Using various APIs, an agent with particular persona can be created. Users can set their behaviors and reactions to different scenarios. User can also set up different tasks to perform according to needs.

  • Database Management:
    Import your knowledge base for extended information to the agent. Is organized into vector databases for ease of recall, hence faster and optimized response rates.

Usage

Import this package into Python using this command. Here is the PyPI website for more details.

pip install agenpy

Starter Code (OpenAI)

Here is a starter code to understand how to use the AgenPy library properly. Create a file named demo.py and paste the following code into it.

import asyncio
from agenpy import agent

async def run_async_demo():
    bot = agent.SimpleOpenAIAgent(api_key="your-openai-api-key", is_async=True)
    bot.message_log.append({"role": "user", "content": "Tell me a joke."})

    print("Streaming async response:")
    async for chunk in bot.stream():
        print(chunk, end='')

def run_sync_demo():
    bot = agent.SimpleOpenAIAgent(api_key="your-openai-api-key", is_async=False)
    bot.message_log.append({"role": "user", "content": "Tell me a joke."})

    print("Streaming sync response:")
    for chunk in bot.stream():
        print(chunk, end='')

if __name__ == "__main__":
    print("Running async demo:")
    asyncio.run(run_async_demo())

    print("\n\nRunning sync demo:")
    run_sync_demo()

Edit the keys in the given code such that they are your OpenAI API keys. To execute this code, run the command:

python demo.py

Donate & Help

If you want to help in the maintenance of this package and keep it open and free for everyone, consider making a donation. It's optional, but we'll be grateful if you did. All of the donations go straight into the development of this package only.

Crypto Network Wallet
Bitcoin bc1qppcjpkcpsrxc35z9zcqcdvtzk333qslc9ft32j
Ethereum 0xc1a9A83fE19a37e362652D9Ca6b7cA12fF3E875d

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

agenpy-0.1.2.tar.gz (6.6 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: agenpy-0.1.2.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for agenpy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 94775e464f16211607edc7b846839f5d75872e35e1b1ee7234ce09009864f9eb
MD5 eb7ae6b3bbe75d7b00d93fdfcf078ebc
BLAKE2b-256 00e26528a899aa875a3ceb985d7dafefcffc0da80dcb91849a32b3d24883ebb7

See more details on using hashes here.

Supported by

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