AutoGemini - 流式Gemini API处理系统
Project description
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—— 项目配置
依赖
- Python >= 3.10
- aiohttp, httpx, requests, websockets
测试
推荐使用 uv 运行测试:
uv run python tests/run_interactive_test.py
或直接运行 pytest:
pytest
贡献
欢迎提交 issue 和 PR!如需自定义工具函数,请参考 src/autogemini/tool_code.py。
License
本项目采用 MIT License,详见根目录 LICENSE 文件。
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file autogemini-0.1.2.post1-py3-none-any.whl.
File metadata
- Download URL: autogemini-0.1.2.post1-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e7acfdb2fc62fe24bd4059acc29c05b37ad70a7add6f46beb9cf2719cefdbc7
|
|
| MD5 |
56598ec56c0590fda3af89168ae3ac5e
|
|
| BLAKE2b-256 |
d4a3dbc7d34b9a102b4e4f60e70a35ab3d13ab135d39541cf2180c7259a7ffe4
|