AutoGemini
流式 Gemini API 处理系统 —— 自动化 AI 工具调用与响应
项目简介
AutoGemini 是一个基于 Python 的流式 Gemini API 处理系统,支持自动化工具代码(ToolCode)检测、执行与多轮推理,适用于需要复杂链式思考(Chain of Thought, COT)和工具调用的 AI 应用场景。
- 流式输出:支持 AI 响应的流式处理,实时检测并执行 ToolCode。
- 自动循环推理:内置 COT 推理流程,自动多轮调用工具并合成最终答案。
- 可扩展工具接口:通过
DefaultApi可自定义扩展工具函数。 - 语义 HTML 响应:最终输出为结构化 HTML,便于前端解析与展示。
主要功能
- Gemini API 流式对话与工具调用
- ToolCode 检测与安全执行
- 多轮推理与自动循环
- 结构化 HTML 响应生成
- 易于集成与二次开发
安装方法
建议使用 uv 进行依赖管理:
uv pip install -e .
或使用 pip:
pip install -e .
快速开始
作为命令行工具运行
python -m autogemini
作为库集成
from autogemini import AutoStreamProcessor
processor = AutoStreamProcessor(api_key="YOUR_GEMINI_API_KEY")
# 详细用法见 src/autogemini/auto_stream_processor.py
目录结构
src/autogemini/—— 主代码目录tests/—— 测试用例pyproject.toml—— 项目配置
测试
推荐使用 uv 运行测试:
uv run python tests/run_interactive_test.py
或直接运行 pytest:
pytest
贡献
欢迎提交 issue 和 PR!如需自定义工具函数,请参考 src/autogemini/tool_code.py。
License
本项目采用 MIT License,详见根目录 LICENSE 文件。
Metadata
Release files for autogemini 0.1.6.post1
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 | Actions |
|---|---|---|---|---|
| autogemini-0.1.6.post1.tar.gz | 65.4 kB | Without provenance | Details for autogemini-0.1.6.post1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| autogemini-0.1.6.post1-py3-none-any.whl | Python 3 | none | any | Details for autogemini-0.1.6.post1-py3-none-any.whl |
Total release size: 91.6 kB
Release files / autogemini-0.1.6.post1.tar.gz
| Download URL | autogemini-0.1.6.post1.tar.gz |
|---|---|
| Size | 65.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3878779a066b1443dc6ff980767ab782596151853a64ddcf1c87aeccd87a306
|
|
BLAKE2b-256 checksum How to use checksums |
51f5f5cb7b200fc6abfab55813444782ad28795580a85d028473eaf74af29c23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.15
|
Release files / autogemini-0.1.6.post1-py3-none-any.whl
| Download URL | autogemini-0.1.6.post1-py3-none-any.whl |
|---|---|
| Size | 26.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3dd76587118b5ad7b9dd1f4fd11b3d3c2513250d33b381aff81da0133e675d0b
|
|
BLAKE2b-256 checksum How to use checksums |
f8680607ef442ca38a86463e268503f9632a3d7d697a7c5572e7a218bd800e50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.15
|
Security for autogemini 0.1.6.post1
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.