VirtualOffice Agent SDK — 透明拦截转发 + 平台 API 封装
Project description
vokit — VirtualOffice Agent SDK
一行 import vokit 完成拦截激活 + API 就绪。
安装
# 预发布版本
pip install git+http://oauth2:YOUR_TOKEN@gitlab.deepleaper.com/deepbrain/vokit-sdk.git@prerelease
快速开始
1. 拦截 LLM 请求
在 Agent 的入口文件最顶部 import 一次即可:
import vokit
- 只需 import 一次:patch 注册在进程级别的 HTTP 库入口,全局生效。
- 放在最顶部:确保在所有 LLM SDK 被 import 之前 patch 已注册好。
- 幂等安全:多次 import 不会重复注册。
2. 使用平台 API
import vokit
# 提交产出物
vokit.submit_output(
output_type="text",
content="分析报告内容..."
)
# 查询工位资源
resources = vokit.get_resources()
# 上报任务状态
vokit.report_status(tasks=[
{"name": "task-1", "status": "running", "progress": 0.75},
])
# 上报指标数据
vokit.report_metrics(metrics=[
{"metricType": "tokens_used", "metricValue": 1500, "snapshotDate": "2026-04-14"},
])
运行模式
开发模式
不设置 VO_GATEWAY_URL 和 VO_ACCESS_TOKEN 时自动进入:
- LLM 请求直连 Provider,不被拦截
- 平台 API 返回 Mock 数据
export OPENAI_API_KEY="your-key"
python your_agent.py
生产模式
设置环境变量后自动进入:
export VO_GATEWAY_URL=http://localhost:8888
export VO_ACCESS_TOKEN=<your-jwt-token>
export OPENAI_API_KEY="your-key"
python your_agent.py
环境变量
| 变量 | 说明 |
|---|---|
VO_GATEWAY_URL |
内网网关地址,缺失则进入开发模式 |
VO_ACCESS_TOKEN |
网关 Bearer Token,缺失则进入开发模式 |
Python 版本
要求 Python 3.10+
License
MIT
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
vokit-0.1.4.tar.gz
(24.2 kB
view details)
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
vokit-0.1.4-py3-none-any.whl
(15.7 kB
view details)
File details
Details for the file vokit-0.1.4.tar.gz.
File metadata
- Download URL: vokit-0.1.4.tar.gz
- Upload date:
- Size: 24.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e4f90f46d86f0f342c3521369de43fd8df85ec376b540169b80dbbea66c54a1
|
|
| MD5 |
a56761a44197ac70c48935ed0cf3e4da
|
|
| BLAKE2b-256 |
9d44fe3877a68e54c2486ae15b5597d144c6446eab6399a38c27a7cb9e533e7c
|
File details
Details for the file vokit-0.1.4-py3-none-any.whl.
File metadata
- Download URL: vokit-0.1.4-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18725fd042fa898980c3a5cd1c42c687f265b3f588aa74c08bb7daebfc904e28
|
|
| MD5 |
1837cea056af1d70623fd5ce1eb3a20a
|
|
| BLAKE2b-256 |
bb0adf85d8f579cdd35b572963eb103af68890efa991a7ba6fa0fea0759e25a9
|