ark_sdk_test - 火山方舟API SDK
ark_sdk_test是火山方舟平台的Python SDK,提供了对文本生成、文生图和视频生成API的封装。
安装
从PyPI安装(推荐)
pip install ark_sdk_test
从源码安装
pip install -r requirements.txt
安装
从PyPI安装(推荐)
pip install ark_sdk_test
从源码安装
pip install .
使用说明
- 克隆项目到本地
- 安装依赖:
pip install -r requirements.txt - 在代码中导入SDK并使用
运行测试
# 运行测试
pytest
# 或者运行测试并生成覆盖率报告
pytest --cov=ark_sdk_test --cov-report=html
初始化SDK
from ark_sdk_test import VolcEngineSDK
# 使用您的API密钥初始化SDK
sdk = VolcEngineSDK("YOUR_API_KEY")
文本生成 (Chat)
# 调用文本生成接口
response = sdk.chat.chat(
model="doubao-1-5-pro-32k-250115",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
)
print(response)
文生图 (Image Generation)
# 调用文生图接口
response = sdk.image.generate_image(
prompt="一只可爱的猫咪",
model="doubao-seedream-3-0-t2i-250415",
size="1024x1024"
)
print(response)
视频生成 (Video Generation)
# 创建视频生成任务
response = sdk.video.create_video_task(
model="doubao-seedance-1-0-pro-250528",
content=[
{
"type": "text",
"text": "多个镜头。一名侦探进入一间光线昏暗的房间。他检查桌上的线索,手里拿起桌上的某个物品。镜头转向他正在思索。 --ratio 16:9"
}
]
)
task_id = response["id"]
print(f"任务ID: {task_id}")
# 查询任务状态
status = sdk.video.get_video_task(task_id)
print(status)
模块说明
VolcEngineSDK: SDK主类,提供对所有API的访问TextGenerationClient: 文本生成API客户端ImageGenerationClient: 文生图API客户端VideoGenerationClient: 视频生成API客户端
Metadata
Release files for ark-sdk-test 1.0.1
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 |
|---|---|---|---|---|
| ark_sdk_test-1.0.1.tar.gz | 6.9 kB | Without provenance | Details for ark_sdk_test-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ark_sdk_test-1.0.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for ark_sdk_test-1.0.1-py2.py3-none-any.whl |
Total release size: 15.0 kB
Release files / ark_sdk_test-1.0.1.tar.gz
| Download URL | ark_sdk_test-1.0.1.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c8ae8dd9e92eda8bf0ceb2dd50608e4319c865b3879529cf21b65de892b40cdb
|
|
BLAKE2b-256 checksum How to use checksums |
4485b835bff7e0f6d2b5ff7189973c3253129a04d2150b0dccbf709c5ecbea50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.4
|
Release files / ark_sdk_test-1.0.1-py2.py3-none-any.whl
| Download URL | ark_sdk_test-1.0.1-py2.py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
a35a70ae2854291da19ade83902b73e7840ce5422ae22e48d0ebeeb359f5c414
|
|
BLAKE2b-256 checksum How to use checksums |
e25774a4b57ce5b4974fc3bf444309e8e5f0a201805753f549981a07002b0fa5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.4
|
Security for ark-sdk-test 1.0.1
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.