thuway ai tools
Project description
SWAI — Thuway AI 命令行工具
1. 介绍
SWAI 提供一套简洁的命令行工具,用于与 Thuway AI 平台进行交互。你可以使用它完成用户登录、任务提交、任务列表查询、取消任务与下载结果等常见操作。
当前命令行支持的任务类型包含 swbind 与 swdocking。就代码实现而言,提交流程已打通;默认参数解析仍处于演示状态(Demo),后续可按需扩展真实业务参数。
2. 功能特性
- 登录鉴权: API Key 登录,一次登录长久使用。
- 任务提交: 一条命令提交任务到平台,支持选择任务类型与订阅完成邮件。
- 任务查询: 按状态、类型、数量上限或任务 ID 查看任务列表。
- 取消任务: 通过任务 ID 取消正在排队或运行的任务。
- 结果下载: 通过任务 ID 下载任务结果到本地文件。
3. 安装
conda create -n swai_env python=3.10
conda activate swai_env
pip install swai
swai_env 是创建的虚拟环境名称,虚拟环境使用python3.10版本,支持最低版本为3.8
4. 快速开始
4.1 查看帮助
swai help
# 或
swai -h
4.2 登录(首次使用必须先登录)
swai login <YOUR_API_KEY>
<YOUR_API_KEY> 是用户使用系统的密钥,在ThuwayAI平台注册账号后,可在个人主页获取访问令牌
4.3 提交任务
swai submit -t {swbind|swdocking} -i <task_input_file>
说明:
| 参数 | 说明 | 是否必需 | 示例 |
|---|---|---|---|
-t, --task_type |
任务类型,支持 swbind、swdocking | 是 | -t swbind |
-i, --task_input |
任务输入文件路径 | 是 | -i input.zip |
示例
# 提交swbind任务
swai submit -t swbind -i D:/workspace/swbind-input.zip
4.4 查询任务
# 按条件筛选
swai list [-s {queued,running,done,failed,cancelled,all}] [-t {swbind,swdocking,all}] [-l <limit>]
## 示例
swai list -s done -t swdocking -l 1
# 按任务 ID 精确查询
swai list -i <task_id>
## 示例
swai list -i swdocking123456
说明:
| 参数 | 说明 | 是否必需 | 默认值 | 示例 |
|---|---|---|---|---|
-s, --status |
任务状态过滤,可选:queued、running、done、failed、cancelled、all | 否 | all | -s running |
-t, --task_type |
任务类型过滤,可选:swbind、swdocking、all | 否 | all | -t swbind |
-l, --limit |
返回任务数量上限 | 否 | 50 | -l 10 |
-i, --task_id |
指定任务 ID 精确查询 | 否 | 无 | -i swdocking123456 |
4.5 取消任务
# 取消id为<task_id>的任务
swai cancel <task_id>
## 示例
swai cancel swdocking123456
4.6 下载结果
# 下载id为<task_id>的结果,可通过`-o`参数指定下载路径
swai download <task_id> [-o <output_file>]
## 示例
swai download swdocking123456 -o result.zip
不指定 -o/--output 时,默认保存为 <task_id>.zip。
5. 常见问题
- 网络错误:若提示连接失败,请检查网络或服务端地址是否可达。
- 登录失败:若提示 API Key 错误,请确认密钥是否正确且已在平台开通权限。
- 无法下载:确保任务状态为
done,且已成功登录(本地存在缓存的 API Key)。
6. 许可证
本项目采用 Apache License 2.0 许可。
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
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 swai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: swai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7580437625a31a8d79b2b3b4b7d6f688624ef0dd26da0c7dfcb62967de838474
|
|
| MD5 |
d898d37654db157e417ca2b736bd40b9
|
|
| BLAKE2b-256 |
9a75505c05ba5fcc43ec742302cd4052685d03f0e8161eb0c12daf4d5afc6179
|