aient
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:
- Create a new Python file in the
aient/src/aient/pluginsdirectory, for example,myplugin.py. Register the plugin by adding the@register_tool()decorator above the function. Importregister_toolwithfrom .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.
Metadata
Release files for aient 1.2.57
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aient-1.2.57.tar.gz | 128.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aient-1.2.57-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 260.9 kB
Release files / aient-1.2.57.tar.gz
| Download URL | aient-1.2.57.tar.gz |
|---|---|
| Size | 128.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6972551db9d5fb2dcac421e7f18e414565f6c8d769a3a183b7214d0385ad892f
|
|
BLAKE2b-256 checksum How to use checksums |
1a45fc62962149ab07153c3bbdff83de956c32eda24a9bf842607deaaa9ac119
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / aient-1.2.57-py3-none-any.whl
| Download URL | aient-1.2.57-py3-none-any.whl |
|---|---|
| Size | 132.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5fe799aabe57a40ee37015ea889462043901cd83e307c05f7db7f992d666d831
|
|
BLAKE2b-256 checksum How to use checksums |
9e0b01326879bd719e714686b4dea3b2a56b288dc7b586b4b15ce7a2dd9892f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for aient 1.2.57
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.