Lingjing AWB Python SDK
AWB API 的同步与 asyncio 客户端,要求 Python 3.11+。包名 lingjing-awb,导入名 lingjing_awb。
python -m pip install lingjing-awb
from lingjing_awb import AwbClient, ImagePromptParams
with AwbClient(access_key="...", project_group_no="...") as client:
print(client.models.list("IMAGE_CREATE"))
task = client.images.create(
model_group_code="...",
prompt_params=ImagePromptParams(prompt="一只小猫"),
)
print(task.task_id)
result = client.tasks.wait(task.task_id)
print(result.is_success, result.result_urls)
异步客户端为 AsyncAwbClient,通过 async with 使用,方法加 await。支持自定义 HTTPX 客户端,其生命周期由调用方管理。
认证和地址可以从 LINGJING_AWB_ACCESS_KEY、LINGJING_AWB_API_ORIGIN 读取,显式构造参数优先。默认访问 https://animeworkbench.lingjingai.cn,不读取 CLI 状态文件。
业务域包括:auth、account、projects、credits、models、uploads、images、videos、audio、tasks、asset_groups、assets、subjects、voices。覆盖 lj-awb 的 49 个 API 封装。
uploads.upload(path, scene_type=...)显式上传本地文件,返回backend_path。images/videos/audio.estimate()估价,create()提交任务,tasks.wait()等待终态。images/videos/subjects.create_batch()有界并发提交并保留逐项结果。subjects.wait()和voices.wait()等待可用的external_id。- 标准输入输出使用 Pydantic 模型,动态模型配置和原生分页响应保留
JsonValue。 - 不隐式上传、补模型默认参数、改写 prompt、估价或重试。生成会创建真实任务。
运行时错误继承 AwbError。HTTP 请求默认超时 20 秒,任务查询、素材注册和 COS PUT 为 60 秒,可由客户端或单次参数覆盖。任务等待默认 300 秒、每 30 秒查询;超时异常保留 ID 与最近状态。
SOCKS 代理可选支持:python -m pip install 'lingjing-awb[socks]'。本地源码安装:python -m pip install .。仓库开发使用 uv sync,运行 uv run pytest、uv run ruff check .、uv run mypy,打包使用 uv build。
完整中文文档、接口覆盖表、多语言共享契约样例和 Python 示例随源码仓库提供。测试使用 MockTransport,不访问真实平台。
Metadata
Release files for lingjing-awb 0.1.0
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 |
|---|---|---|---|---|
| lingjing_awb-0.1.0.tar.gz | 22.4 kB | Without provenance | Details for lingjing_awb-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lingjing_awb-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for lingjing_awb-0.1.0-py3-none-any.whl |
Total release size: 57.7 kB
Release files / lingjing_awb-0.1.0.tar.gz
| Download URL | lingjing_awb-0.1.0.tar.gz |
|---|---|
| Size | 22.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fca0b84d157b2768d223f7b8f41071b50ab4b082a5722a8f403fecbfa1ad84ee
|
|
BLAKE2b-256 checksum How to use checksums |
28c896b3f1ebe6af0d80d87cddc4a46386927e17afb876cb55999e065b8c373f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / lingjing_awb-0.1.0-py3-none-any.whl
| Download URL | lingjing_awb-0.1.0-py3-none-any.whl |
|---|---|
| Size | 35.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
25facf4b954c9c1e3b11ff7d0dad668f209b740d68a71d1d5cbf2dd8cd593dc7
|
|
BLAKE2b-256 checksum How to use checksums |
79c81b79f47179e57b227bc81569acb11e3a9a83f3131413f73c647835422a48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for lingjing-awb 0.1.0
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.