Skip to main content

Aient: The Awakening of Agent.

Project description

aient

English | Chinese

aient is a powerful library designed to simplify and unify the use of different large language models, including gpt-4.1/5, o3, DALL-E 3, claude4, gemini-2.5-pro/flash, Vertex AI (Claude, Gemini), and Groq. The library supports GPT format function calls and has built-in Google search and URL summarization features, greatly enhancing the practicality and flexibility of the models.

✨ Features

  • Multi-model support: Integrate various latest large language models.
  • Real-time Interaction: Supports real-time query streams, real-time model response retrieval.
  • Function Expansion: With built-in function calling support, the model's functions can be easily expanded, currently supporting plugins such as DuckDuckGo and Google search, content summarization, Dalle-3 drawing, arXiv paper summaries, current time, code interpreter, and more.
  • Simple Interface: Provides a concise and unified API interface, making it easy to call and manage the model.

Quick Start

The following is a guide on how to quickly integrate and use aient in your Python project.

Install

First, you need to install aient. It can be installed directly via pip:

pip install aient

Usage example

The following is a simple example demonstrating how to use aient to request the GPT-4 model and handle the returned streaming data:

from aient import chatgpt

# Initialize the model, set the API key and the selected model
bot = chatgpt(api_key="{YOUR_API_KEY}", engine="gpt-4o")

# Get response
result = bot.ask("python list use")

# Send request and get streaming response in real-time
for text in bot.ask_stream("python list use"):
    print(text, end="")

# Disable all plugins
bot = chatgpt(api_key="{YOUR_API_KEY}", engine="gpt-4o", use_plugins=False)

🍃 Environment Variables

The following is a list of environment variables related to plugin settings:

Variable Name Description Required?
get_search_results Enable search plugin. Default value is False. No
get_url_content Enable URL summary plugin. The default value is False. No
download_read_arxiv_pdf Whether to enable the arXiv paper abstract plugin. The default value is False. No
run_python_script Whether to enable the code interpreter plugin. The default value is False. No
generate_image Whether to enable the image generation plugin. The default value is False. No
get_time Whether to enable the date plugin. The default value is False. No

Supported models

  • gpt-4.1/5
  • o3
  • DALL-E 3
  • claude4
  • gemini-2.5-pro/flash
  • Vertex AI (Claude, Gemini)
  • Groq

🧩 Plugin

This project supports multiple plugins, including: DuckDuckGo and Google search, URL summary, ArXiv paper summary, DALLE-3 drawing, and code interpreter, etc. You can enable or disable these plugins by setting environment variables.

  • How to develop a plugin?

The plugin-related code is all in the aient git submodule of this repository. aient is an independent repository I developed for handling API requests, conversation history management, and other functionality. When you clone this repository with the --recurse-submodules parameter, aient will be automatically downloaded. All plugin code is located in the relative path aient/src/aient/plugins in this repository. You can add your own plugin code in this directory. The plugin development process is as follows:

  1. Create a new Python file in the aient/src/aient/plugins directory, for example, myplugin.py. Register the plugin by adding the @register_tool() decorator above the function. Import register_tool with from .registry import register_tool.

After completing the above steps, your plugin is ready to use. 🎉

License

This project is licensed under the MIT License.

Contribution

Welcome to contribute improvements by submitting issues or pull requests through GitHub.

Contact Information

If you have any questions or need assistance, please contact us at yym68686@outlook.com.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

aient-1.1.88.tar.gz (93.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aient-1.1.88-py3-none-any.whl (96.2 kB view details)

Uploaded Python 3

File details

Details for the file aient-1.1.88.tar.gz.

File metadata

  • Download URL: aient-1.1.88.tar.gz
  • Upload date:
  • Size: 93.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for aient-1.1.88.tar.gz
Algorithm Hash digest
SHA256 278e5b2cced1d0c3e4974c5fe70c698aedc45dfcab9523709245c5ad066a0b65
MD5 d916f22442d51b500a99a77f9d47b9f1
BLAKE2b-256 55f415850f2ed719d8a5304bc7b7e717f7738a23a6cdd0a1a5e5f3863ad76a3f

See more details on using hashes here.

File details

Details for the file aient-1.1.88-py3-none-any.whl.

File metadata

  • Download URL: aient-1.1.88-py3-none-any.whl
  • Upload date:
  • Size: 96.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for aient-1.1.88-py3-none-any.whl
Algorithm Hash digest
SHA256 99aa94ee82e2438362c500a6698c728401b418ea79b8a25b1e4fce9b3eefb27d
MD5 f3e462f99c03c8adddbc1a724446bc1a
BLAKE2b-256 23b80ddf385729dee114163f4ababa4bd67e620b30a3ab7272a112dc106f489d

See more details on using hashes here.

Supported by

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