chattool 7.1.1__tar.gz → 7.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {chattool-7.1.1/src/chattool.egg-info → chattool-7.1.2}/PKG-INFO +13 -11
- {chattool-7.1.1 → chattool-7.1.2}/README.md +9 -8
- {chattool-7.1.1 → chattool-7.1.2}/pyproject.toml +3 -2
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/__init__.py +1 -1
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/client/main.py +0 -1
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/config/__init__.py +0 -10
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/config/elements.py +0 -10
- {chattool-7.1.1 → chattool-7.1.2/src/chattool.egg-info}/PKG-INFO +13 -11
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool.egg-info/SOURCES.txt +0 -15
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool.egg-info/requires.txt +3 -2
- chattool-7.1.1/src/chattool/config/huggingface.py +0 -28
- chattool-7.1.1/src/chattool/config/liblib.py +0 -33
- chattool-7.1.1/src/chattool/config/pollinations.py +0 -23
- chattool-7.1.1/src/chattool/config/siliconflow.py +0 -29
- chattool-7.1.1/src/chattool/config/tongyi.py +0 -33
- chattool-7.1.1/src/chattool/tools/image/__init__.py +0 -45
- chattool-7.1.1/src/chattool/tools/image/base.py +0 -30
- chattool-7.1.1/src/chattool/tools/image/cli.py +0 -423
- chattool-7.1.1/src/chattool/tools/image/codex.py +0 -393
- chattool-7.1.1/src/chattool/tools/image/helpers.py +0 -96
- chattool-7.1.1/src/chattool/tools/image/huggingface.py +0 -44
- chattool-7.1.1/src/chattool/tools/image/liblib.py +0 -150
- chattool-7.1.1/src/chattool/tools/image/pollinations.py +0 -56
- chattool-7.1.1/src/chattool/tools/image/siliconflow.py +0 -92
- chattool-7.1.1/src/chattool/tools/image/tongyi.py +0 -61
- {chattool-7.1.1 → chattool-7.1.2}/LICENSE +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/MANIFEST.in +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/scripts/migrate_chattool_envs_to_chatarch.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/setup.cfg +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/_all.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/client/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/client/cert_client.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/client/svg2gif_client.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/config/aliyun.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/config/azure.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/config/base.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/config/browser.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/config/crs.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/config/openai.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/config/skills.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/config/tencent.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/config/tplink.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/config/zulip.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/const.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/docker/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/docker/cli.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/docker/elements.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/docker/main.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/explore/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/explore/arxiv/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/explore/arxiv/cli.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/explore/arxiv/client.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/explore/arxiv/daily.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/explore/arxiv/harvest.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/explore/arxiv/models.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/explore/arxiv/presets.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/explore/arxiv/query.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/explore/cli.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/explore/wordpress/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/explore/wordpress/client.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/explore/wordpress/models.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/interaction/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/interaction/command_schema.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/interaction/policy.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/interaction/warnings.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/llm/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/llm/chattype.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/llm/response.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/mcp/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/mcp/catalog.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/mcp/cli.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/mcp/server.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/serve/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/serve/capture.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/serve/cert_server.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/serve/cli.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/serve/local.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/serve/oauth.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/serve/svg2gif.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/skill/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/skill/cli.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/skill/interaction.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/skill/platforms.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/skill/validation.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/browser/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/browser/base.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/browser/cli.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/browser/playwright_impl.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/browser/selenium.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/browser/test_browser.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/browser/test_module.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/browser/test_remote.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/browser/xhs_qrcode.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/cc/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/cc/cli.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/cert/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/cert/cert_server.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/cert/email.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/crs/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/crs/api.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/crs/cli.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/crs/openai_oauth.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/interact.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/nginx/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/nginx/cli.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/nginx/templates.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/tplogin.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/tplogin_cli.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/zulip/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/zulip/cli.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/zulip/client.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/zulip/legacy.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/tools/zulip/mcp.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/utils/__init__.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/utils/basic.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/utils/custom_logger.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/utils/fastobj.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/utils/httpclient.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/utils/pathing.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/utils/test_helpers.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool/utils/urltool.py +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool.egg-info/dependency_links.txt +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool.egg-info/entry_points.txt +0 -0
- {chattool-7.1.1 → chattool-7.1.2}/src/chattool.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chattool
|
|
3
|
-
Version: 7.1.
|
|
3
|
+
Version: 7.1.2
|
|
4
4
|
Summary: Toolkit for Chat API
|
|
5
5
|
Author-email: Rex Wang <1073853456@qq.com>
|
|
6
6
|
License: MIT license
|
|
@@ -18,7 +18,7 @@ Description-Content-Type: text/markdown
|
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: Click>=7.0
|
|
20
20
|
Requires-Dist: chatstyle<0.2.0,>=0.1.0
|
|
21
|
-
Requires-Dist: chatenv<0.3.0,>=0.2.
|
|
21
|
+
Requires-Dist: chatenv<0.3.0,>=0.2.2
|
|
22
22
|
Requires-Dist: requests>=2.20
|
|
23
23
|
Requires-Dist: python-dotenv>=0.17.0
|
|
24
24
|
Requires-Dist: colorama
|
|
@@ -30,6 +30,7 @@ Requires-Dist: ChatUp<0.3.0,>=0.2.0; extra == "arch"
|
|
|
30
30
|
Requires-Dist: ChatPyPI<0.3.0,>=0.2.3; extra == "arch"
|
|
31
31
|
Requires-Dist: ChatNet<0.3.0,>=0.2.0; extra == "arch"
|
|
32
32
|
Requires-Dist: ChatLark<0.2.0,>=0.1.1; extra == "arch"
|
|
33
|
+
Requires-Dist: ChatImg[images]<0.2.0,>=0.1.3; extra == "arch"
|
|
33
34
|
Provides-Extra: interactive
|
|
34
35
|
Requires-Dist: questionary>=2.1.0; extra == "interactive"
|
|
35
36
|
Requires-Dist: prompt_toolkit; extra == "interactive"
|
|
@@ -41,7 +42,7 @@ Requires-Dist: ChatDNS<0.2.0,>=0.1.1; extra == "dns"
|
|
|
41
42
|
Provides-Extra: lark
|
|
42
43
|
Requires-Dist: ChatLark<0.2.0,>=0.1.1; extra == "lark"
|
|
43
44
|
Provides-Extra: images
|
|
44
|
-
Requires-Dist:
|
|
45
|
+
Requires-Dist: ChatImg[images]<0.2.0,>=0.1.3; extra == "images"
|
|
45
46
|
Provides-Extra: screenshot
|
|
46
47
|
Requires-Dist: selenium; extra == "screenshot"
|
|
47
48
|
Requires-Dist: pillow; extra == "screenshot"
|
|
@@ -233,16 +234,17 @@ chattool nginx static-root ./nas.conf --set SERVER_NAME=share.example.com --set
|
|
|
233
234
|
chattool nginx -i # 交互式选择模板并逐项填写
|
|
234
235
|
```
|
|
235
236
|
|
|
236
|
-
### AI 绘图 (`
|
|
237
|
+
### AI 绘图 (`chatimg`)
|
|
237
238
|
|
|
238
239
|
```bash
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
pip install "chattool[images]"
|
|
241
|
+
chatimg pollinations generate "a cat in space" -o cat.png
|
|
242
|
+
chatimg siliconflow generate "a cute dog" -o dog.png
|
|
243
|
+
chatimg codex generate "a watercolor fox"
|
|
244
|
+
chatimg openai generate "a clean app icon"
|
|
243
245
|
```
|
|
244
246
|
|
|
245
|
-
|
|
247
|
+
AI image provider 能力已迁移到独立 `ChatImg` / `chatimg`;`chattool image` 已移除,避免 ChatTool 继续持有重复 image provider 实现。
|
|
246
248
|
|
|
247
249
|
### 数据探索 (`chattool explore`)
|
|
248
250
|
|
|
@@ -301,11 +303,11 @@ chatpypi init -i # 交互式选择模板、mkdocs/workflow 等
|
|
|
301
303
|
chatpypi probe mychat
|
|
302
304
|
```
|
|
303
305
|
|
|
304
|
-
也可以通过 `pip install "chattool[arch]"` 一次性安装 ChatGH、ChatUp、ChatPyPI、ChatNet。
|
|
306
|
+
也可以通过 `pip install "chattool[arch]"` 一次性安装 ChatGH、ChatUp、ChatPyPI、ChatNet、ChatLark、ChatImg。
|
|
305
307
|
|
|
306
308
|
`ChatPyPI` / `chatpypi` 是 Python 包创建、构建、校验、上传与探测能力的 canonical owner;ChatTool 不再内置 `chattool pypi` 或 `chatpypi` wrapper。
|
|
307
309
|
|
|
308
|
-
默认模板生成的 `pyproject.toml` 会写入 `requires-python = ">=3.9"`;`chatarch` 模板默认写入 `requires-python = ">=3.10"`,并依赖 `chatstyle>=0.1.0,<0.2.0` 与 `chatenv>=0.2.
|
|
310
|
+
默认模板生成的 `pyproject.toml` 会写入 `requires-python = ">=3.9"`;`chatarch` 模板默认写入 `requires-python = ">=3.10"`,并依赖 `chatstyle>=0.1.0,<0.2.0` 与 `chatenv>=0.2.2,<0.3.0`。
|
|
309
311
|
|
|
310
312
|
`chatarch` 模板会额外生成 `DEVELOP.md`、`CHANGELOG.md`、`AGENTS.md`、`README.en.md`、`mkdocs.yml`、`docs/`、`tests/cli-tests/`、`tests/mock-cli-tests/`、`tests/code-tests/` 与 `.github/workflows/` 骨架;发布 workflow 由显式 `v*` tag 或 `workflow_dispatch` 触发,校验 tag 与包内 `__version__` 一致,并通过 PyPI Trusted Publishing 发布。默认不写 `environment: pypi`,除非 PyPI Trusted Publisher 明确配置了同名 environment。
|
|
311
313
|
|
|
@@ -143,16 +143,17 @@ chattool nginx static-root ./nas.conf --set SERVER_NAME=share.example.com --set
|
|
|
143
143
|
chattool nginx -i # 交互式选择模板并逐项填写
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
### AI 绘图 (`
|
|
146
|
+
### AI 绘图 (`chatimg`)
|
|
147
147
|
|
|
148
148
|
```bash
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
149
|
+
pip install "chattool[images]"
|
|
150
|
+
chatimg pollinations generate "a cat in space" -o cat.png
|
|
151
|
+
chatimg siliconflow generate "a cute dog" -o dog.png
|
|
152
|
+
chatimg codex generate "a watercolor fox"
|
|
153
|
+
chatimg openai generate "a clean app icon"
|
|
153
154
|
```
|
|
154
155
|
|
|
155
|
-
|
|
156
|
+
AI image provider 能力已迁移到独立 `ChatImg` / `chatimg`;`chattool image` 已移除,避免 ChatTool 继续持有重复 image provider 实现。
|
|
156
157
|
|
|
157
158
|
### 数据探索 (`chattool explore`)
|
|
158
159
|
|
|
@@ -211,11 +212,11 @@ chatpypi init -i # 交互式选择模板、mkdocs/workflow 等
|
|
|
211
212
|
chatpypi probe mychat
|
|
212
213
|
```
|
|
213
214
|
|
|
214
|
-
也可以通过 `pip install "chattool[arch]"` 一次性安装 ChatGH、ChatUp、ChatPyPI、ChatNet。
|
|
215
|
+
也可以通过 `pip install "chattool[arch]"` 一次性安装 ChatGH、ChatUp、ChatPyPI、ChatNet、ChatLark、ChatImg。
|
|
215
216
|
|
|
216
217
|
`ChatPyPI` / `chatpypi` 是 Python 包创建、构建、校验、上传与探测能力的 canonical owner;ChatTool 不再内置 `chattool pypi` 或 `chatpypi` wrapper。
|
|
217
218
|
|
|
218
|
-
默认模板生成的 `pyproject.toml` 会写入 `requires-python = ">=3.9"`;`chatarch` 模板默认写入 `requires-python = ">=3.10"`,并依赖 `chatstyle>=0.1.0,<0.2.0` 与 `chatenv>=0.2.
|
|
219
|
+
默认模板生成的 `pyproject.toml` 会写入 `requires-python = ">=3.9"`;`chatarch` 模板默认写入 `requires-python = ">=3.10"`,并依赖 `chatstyle>=0.1.0,<0.2.0` 与 `chatenv>=0.2.2,<0.3.0`。
|
|
219
220
|
|
|
220
221
|
`chatarch` 模板会额外生成 `DEVELOP.md`、`CHANGELOG.md`、`AGENTS.md`、`README.en.md`、`mkdocs.yml`、`docs/`、`tests/cli-tests/`、`tests/mock-cli-tests/`、`tests/code-tests/` 与 `.github/workflows/` 骨架;发布 workflow 由显式 `v*` tag 或 `workflow_dispatch` 触发,校验 tag 与包内 `__version__` 一致,并通过 PyPI Trusted Publishing 发布。默认不写 `environment: pypi`,除非 PyPI Trusted Publisher 明确配置了同名 environment。
|
|
221
222
|
|
|
@@ -24,7 +24,7 @@ license = {text = "MIT license"}
|
|
|
24
24
|
dependencies = [
|
|
25
25
|
"Click>=7.0",
|
|
26
26
|
"chatstyle>=0.1.0,<0.2.0",
|
|
27
|
-
"chatenv>=0.2.
|
|
27
|
+
"chatenv>=0.2.2,<0.3.0",
|
|
28
28
|
"requests>=2.20",
|
|
29
29
|
"python-dotenv>=0.17.0",
|
|
30
30
|
"colorama",
|
|
@@ -39,6 +39,7 @@ arch = [
|
|
|
39
39
|
"ChatPyPI>=0.2.3,<0.3.0",
|
|
40
40
|
"ChatNet>=0.2.0,<0.3.0",
|
|
41
41
|
"ChatLark>=0.1.1,<0.2.0",
|
|
42
|
+
"ChatImg[images]>=0.1.3,<0.2.0",
|
|
42
43
|
]
|
|
43
44
|
interactive = [
|
|
44
45
|
"questionary>=2.1.0",
|
|
@@ -55,7 +56,7 @@ lark = [
|
|
|
55
56
|
"ChatLark>=0.1.1,<0.2.0",
|
|
56
57
|
]
|
|
57
58
|
images = [
|
|
58
|
-
"
|
|
59
|
+
"ChatImg[images]>=0.1.3,<0.2.0",
|
|
59
60
|
]
|
|
60
61
|
screenshot = [
|
|
61
62
|
"selenium",
|
|
@@ -85,7 +85,6 @@ cli._lazy_commands.update(
|
|
|
85
85
|
"client": _build_client_group,
|
|
86
86
|
"nginx": lambda: _load_attr("chattool.tools.nginx.cli", "cli"),
|
|
87
87
|
"mcp": lambda: _load_attr("chattool.mcp.cli", "cli"),
|
|
88
|
-
"image": lambda: _load_attr("chattool.tools.image.cli", "cli"),
|
|
89
88
|
"tplogin": lambda: _load_attr("chattool.tools.tplogin_cli", "cli"),
|
|
90
89
|
"browser": lambda: _load_attr("chattool.tools.browser.cli", "cli"),
|
|
91
90
|
"zulip": lambda: _load_attr("chattool.tools.zulip.cli", "cli"),
|
|
@@ -6,11 +6,6 @@ from .azure import AzureConfig
|
|
|
6
6
|
from .aliyun import AliyunConfig
|
|
7
7
|
from .tencent import TencentConfig
|
|
8
8
|
from .zulip import ZulipConfig
|
|
9
|
-
from .tongyi import TongyiConfig
|
|
10
|
-
from .huggingface import HuggingFaceConfig
|
|
11
|
-
from .pollinations import PollinationsConfig
|
|
12
|
-
from .liblib import LiblibConfig
|
|
13
|
-
from .siliconflow import SiliconFlowConfig
|
|
14
9
|
from .tplink import TPLinkConfig
|
|
15
10
|
from .browser import BrowserConfig
|
|
16
11
|
|
|
@@ -24,11 +19,6 @@ __all__ = [
|
|
|
24
19
|
"ZulipConfig",
|
|
25
20
|
"AliyunConfig",
|
|
26
21
|
"TencentConfig",
|
|
27
|
-
"TongyiConfig",
|
|
28
|
-
"HuggingFaceConfig",
|
|
29
|
-
"PollinationsConfig",
|
|
30
|
-
"LiblibConfig",
|
|
31
|
-
"SiliconFlowConfig",
|
|
32
22
|
"BrowserConfig",
|
|
33
23
|
"TPLinkConfig",
|
|
34
24
|
"SkillsConfig",
|
|
@@ -8,11 +8,6 @@ from .azure import AzureConfig
|
|
|
8
8
|
from .aliyun import AliyunConfig
|
|
9
9
|
from .tencent import TencentConfig
|
|
10
10
|
from .zulip import ZulipConfig
|
|
11
|
-
from .tongyi import TongyiConfig
|
|
12
|
-
from .huggingface import HuggingFaceConfig
|
|
13
|
-
from .pollinations import PollinationsConfig
|
|
14
|
-
from .liblib import LiblibConfig
|
|
15
|
-
from .siliconflow import SiliconFlowConfig
|
|
16
11
|
from .tplink import TPLinkConfig
|
|
17
12
|
from .browser import BrowserConfig
|
|
18
13
|
|
|
@@ -26,11 +21,6 @@ __all__ = [
|
|
|
26
21
|
"ZulipConfig",
|
|
27
22
|
"AliyunConfig",
|
|
28
23
|
"TencentConfig",
|
|
29
|
-
"TongyiConfig",
|
|
30
|
-
"HuggingFaceConfig",
|
|
31
|
-
"PollinationsConfig",
|
|
32
|
-
"LiblibConfig",
|
|
33
|
-
"SiliconFlowConfig",
|
|
34
24
|
"BrowserConfig",
|
|
35
25
|
"TPLinkConfig",
|
|
36
26
|
"SkillsConfig",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chattool
|
|
3
|
-
Version: 7.1.
|
|
3
|
+
Version: 7.1.2
|
|
4
4
|
Summary: Toolkit for Chat API
|
|
5
5
|
Author-email: Rex Wang <1073853456@qq.com>
|
|
6
6
|
License: MIT license
|
|
@@ -18,7 +18,7 @@ Description-Content-Type: text/markdown
|
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: Click>=7.0
|
|
20
20
|
Requires-Dist: chatstyle<0.2.0,>=0.1.0
|
|
21
|
-
Requires-Dist: chatenv<0.3.0,>=0.2.
|
|
21
|
+
Requires-Dist: chatenv<0.3.0,>=0.2.2
|
|
22
22
|
Requires-Dist: requests>=2.20
|
|
23
23
|
Requires-Dist: python-dotenv>=0.17.0
|
|
24
24
|
Requires-Dist: colorama
|
|
@@ -30,6 +30,7 @@ Requires-Dist: ChatUp<0.3.0,>=0.2.0; extra == "arch"
|
|
|
30
30
|
Requires-Dist: ChatPyPI<0.3.0,>=0.2.3; extra == "arch"
|
|
31
31
|
Requires-Dist: ChatNet<0.3.0,>=0.2.0; extra == "arch"
|
|
32
32
|
Requires-Dist: ChatLark<0.2.0,>=0.1.1; extra == "arch"
|
|
33
|
+
Requires-Dist: ChatImg[images]<0.2.0,>=0.1.3; extra == "arch"
|
|
33
34
|
Provides-Extra: interactive
|
|
34
35
|
Requires-Dist: questionary>=2.1.0; extra == "interactive"
|
|
35
36
|
Requires-Dist: prompt_toolkit; extra == "interactive"
|
|
@@ -41,7 +42,7 @@ Requires-Dist: ChatDNS<0.2.0,>=0.1.1; extra == "dns"
|
|
|
41
42
|
Provides-Extra: lark
|
|
42
43
|
Requires-Dist: ChatLark<0.2.0,>=0.1.1; extra == "lark"
|
|
43
44
|
Provides-Extra: images
|
|
44
|
-
Requires-Dist:
|
|
45
|
+
Requires-Dist: ChatImg[images]<0.2.0,>=0.1.3; extra == "images"
|
|
45
46
|
Provides-Extra: screenshot
|
|
46
47
|
Requires-Dist: selenium; extra == "screenshot"
|
|
47
48
|
Requires-Dist: pillow; extra == "screenshot"
|
|
@@ -233,16 +234,17 @@ chattool nginx static-root ./nas.conf --set SERVER_NAME=share.example.com --set
|
|
|
233
234
|
chattool nginx -i # 交互式选择模板并逐项填写
|
|
234
235
|
```
|
|
235
236
|
|
|
236
|
-
### AI 绘图 (`
|
|
237
|
+
### AI 绘图 (`chatimg`)
|
|
237
238
|
|
|
238
239
|
```bash
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
pip install "chattool[images]"
|
|
241
|
+
chatimg pollinations generate "a cat in space" -o cat.png
|
|
242
|
+
chatimg siliconflow generate "a cute dog" -o dog.png
|
|
243
|
+
chatimg codex generate "a watercolor fox"
|
|
244
|
+
chatimg openai generate "a clean app icon"
|
|
243
245
|
```
|
|
244
246
|
|
|
245
|
-
|
|
247
|
+
AI image provider 能力已迁移到独立 `ChatImg` / `chatimg`;`chattool image` 已移除,避免 ChatTool 继续持有重复 image provider 实现。
|
|
246
248
|
|
|
247
249
|
### 数据探索 (`chattool explore`)
|
|
248
250
|
|
|
@@ -301,11 +303,11 @@ chatpypi init -i # 交互式选择模板、mkdocs/workflow 等
|
|
|
301
303
|
chatpypi probe mychat
|
|
302
304
|
```
|
|
303
305
|
|
|
304
|
-
也可以通过 `pip install "chattool[arch]"` 一次性安装 ChatGH、ChatUp、ChatPyPI、ChatNet。
|
|
306
|
+
也可以通过 `pip install "chattool[arch]"` 一次性安装 ChatGH、ChatUp、ChatPyPI、ChatNet、ChatLark、ChatImg。
|
|
305
307
|
|
|
306
308
|
`ChatPyPI` / `chatpypi` 是 Python 包创建、构建、校验、上传与探测能力的 canonical owner;ChatTool 不再内置 `chattool pypi` 或 `chatpypi` wrapper。
|
|
307
309
|
|
|
308
|
-
默认模板生成的 `pyproject.toml` 会写入 `requires-python = ">=3.9"`;`chatarch` 模板默认写入 `requires-python = ">=3.10"`,并依赖 `chatstyle>=0.1.0,<0.2.0` 与 `chatenv>=0.2.
|
|
310
|
+
默认模板生成的 `pyproject.toml` 会写入 `requires-python = ">=3.9"`;`chatarch` 模板默认写入 `requires-python = ">=3.10"`,并依赖 `chatstyle>=0.1.0,<0.2.0` 与 `chatenv>=0.2.2,<0.3.0`。
|
|
309
311
|
|
|
310
312
|
`chatarch` 模板会额外生成 `DEVELOP.md`、`CHANGELOG.md`、`AGENTS.md`、`README.en.md`、`mkdocs.yml`、`docs/`、`tests/cli-tests/`、`tests/mock-cli-tests/`、`tests/code-tests/` 与 `.github/workflows/` 骨架;发布 workflow 由显式 `v*` tag 或 `workflow_dispatch` 触发,校验 tag 与包内 `__version__` 一致,并通过 PyPI Trusted Publishing 发布。默认不写 `environment: pypi`,除非 PyPI Trusted Publisher 明确配置了同名 environment。
|
|
311
313
|
|
|
@@ -23,14 +23,9 @@ src/chattool/config/base.py
|
|
|
23
23
|
src/chattool/config/browser.py
|
|
24
24
|
src/chattool/config/crs.py
|
|
25
25
|
src/chattool/config/elements.py
|
|
26
|
-
src/chattool/config/huggingface.py
|
|
27
|
-
src/chattool/config/liblib.py
|
|
28
26
|
src/chattool/config/openai.py
|
|
29
|
-
src/chattool/config/pollinations.py
|
|
30
|
-
src/chattool/config/siliconflow.py
|
|
31
27
|
src/chattool/config/skills.py
|
|
32
28
|
src/chattool/config/tencent.py
|
|
33
|
-
src/chattool/config/tongyi.py
|
|
34
29
|
src/chattool/config/tplink.py
|
|
35
30
|
src/chattool/config/zulip.py
|
|
36
31
|
src/chattool/docker/__init__.py
|
|
@@ -95,16 +90,6 @@ src/chattool/tools/crs/__init__.py
|
|
|
95
90
|
src/chattool/tools/crs/api.py
|
|
96
91
|
src/chattool/tools/crs/cli.py
|
|
97
92
|
src/chattool/tools/crs/openai_oauth.py
|
|
98
|
-
src/chattool/tools/image/__init__.py
|
|
99
|
-
src/chattool/tools/image/base.py
|
|
100
|
-
src/chattool/tools/image/cli.py
|
|
101
|
-
src/chattool/tools/image/codex.py
|
|
102
|
-
src/chattool/tools/image/helpers.py
|
|
103
|
-
src/chattool/tools/image/huggingface.py
|
|
104
|
-
src/chattool/tools/image/liblib.py
|
|
105
|
-
src/chattool/tools/image/pollinations.py
|
|
106
|
-
src/chattool/tools/image/siliconflow.py
|
|
107
|
-
src/chattool/tools/image/tongyi.py
|
|
108
93
|
src/chattool/tools/nginx/__init__.py
|
|
109
94
|
src/chattool/tools/nginx/cli.py
|
|
110
95
|
src/chattool/tools/nginx/templates.py
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Click>=7.0
|
|
2
2
|
chatstyle<0.2.0,>=0.1.0
|
|
3
|
-
chatenv<0.3.0,>=0.2.
|
|
3
|
+
chatenv<0.3.0,>=0.2.2
|
|
4
4
|
requests>=2.20
|
|
5
5
|
python-dotenv>=0.17.0
|
|
6
6
|
colorama
|
|
@@ -15,6 +15,7 @@ ChatUp<0.3.0,>=0.2.0
|
|
|
15
15
|
ChatPyPI<0.3.0,>=0.2.3
|
|
16
16
|
ChatNet<0.3.0,>=0.2.0
|
|
17
17
|
ChatLark<0.2.0,>=0.1.1
|
|
18
|
+
ChatImg[images]<0.2.0,>=0.1.3
|
|
18
19
|
|
|
19
20
|
[batch]
|
|
20
21
|
batch_executor>=0.3.0
|
|
@@ -50,7 +51,7 @@ mike>=1.1.2
|
|
|
50
51
|
pyparsing>=3.0
|
|
51
52
|
|
|
52
53
|
[images]
|
|
53
|
-
|
|
54
|
+
ChatImg[images]<0.2.0,>=0.1.3
|
|
54
55
|
|
|
55
56
|
[interactive]
|
|
56
57
|
questionary>=2.1.0
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"""HuggingFaceConfig env schema."""
|
|
2
|
-
|
|
3
|
-
from .base import BaseEnvConfig, EnvField
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class HuggingFaceConfig(BaseEnvConfig):
|
|
7
|
-
_title = "Hugging Face Configuration"
|
|
8
|
-
_aliases = ["hf", "huggingface"]
|
|
9
|
-
_storage_dir = "HuggingFace"
|
|
10
|
-
|
|
11
|
-
HUGGINGFACE_HUB_TOKEN = EnvField("HUGGINGFACE_HUB_TOKEN", desc="Hugging Face User Access Token. See https://huggingface.co/settings/tokens", is_sensitive=True)
|
|
12
|
-
|
|
13
|
-
@classmethod
|
|
14
|
-
def test(cls):
|
|
15
|
-
print(f"Testing {cls._title}...")
|
|
16
|
-
try:
|
|
17
|
-
if not cls.HUGGINGFACE_HUB_TOKEN.value:
|
|
18
|
-
print("❌ Failed: HUGGINGFACE_HUB_TOKEN not set")
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
from chattool.tools.image.huggingface import HuggingFaceImageGenerator
|
|
22
|
-
client = HuggingFaceImageGenerator(api_key=cls.HUGGINGFACE_HUB_TOKEN.value)
|
|
23
|
-
print(f"✅ Success! Client initialized with token: {cls.HUGGINGFACE_HUB_TOKEN.mask_value()}")
|
|
24
|
-
except Exception as e:
|
|
25
|
-
print(f"❌ Failed: {e}")
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
__all__ = ["HuggingFaceConfig"]
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"""LiblibConfig env schema."""
|
|
2
|
-
|
|
3
|
-
from .base import BaseEnvConfig, EnvField
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class LiblibConfig(BaseEnvConfig):
|
|
7
|
-
_title = "LiblibAI Configuration"
|
|
8
|
-
_aliases = ["liblib"]
|
|
9
|
-
_storage_dir = "Liblib"
|
|
10
|
-
|
|
11
|
-
LIBLIB_MODEL_ID = EnvField("LIBLIB_MODEL_ID", desc="LiblibAI Model ID. Use `chattool image liblib list-models` to get available models.")
|
|
12
|
-
LIBLIB_ACCESS_KEY = EnvField("LIBLIB_ACCESS_KEY", desc="LiblibAI Access Key. See https://www.liblib.art/apis", is_sensitive=True)
|
|
13
|
-
LIBLIB_SECRET_KEY = EnvField("LIBLIB_SECRET_KEY", desc="LiblibAI Secret Key. See https://www.liblib.art/apis", is_sensitive=True)
|
|
14
|
-
|
|
15
|
-
@classmethod
|
|
16
|
-
def test(cls):
|
|
17
|
-
print(f"Testing {cls._title}...")
|
|
18
|
-
try:
|
|
19
|
-
if not cls.LIBLIB_ACCESS_KEY.value or not cls.LIBLIB_SECRET_KEY.value:
|
|
20
|
-
print("❌ Failed: LIBLIB_ACCESS_KEY or LIBLIB_SECRET_KEY not set")
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
from chattool.tools.image.liblib import LiblibImageGenerator
|
|
24
|
-
client = LiblibImageGenerator(
|
|
25
|
-
access_key=cls.LIBLIB_ACCESS_KEY.value,
|
|
26
|
-
secret_key=cls.LIBLIB_SECRET_KEY.value
|
|
27
|
-
)
|
|
28
|
-
print(f"✅ Success! Client initialized.")
|
|
29
|
-
except Exception as e:
|
|
30
|
-
print(f"❌ Failed: {e}")
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
__all__ = ["LiblibConfig"]
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"""PollinationsConfig env schema."""
|
|
2
|
-
|
|
3
|
-
from .base import BaseEnvConfig, EnvField
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class PollinationsConfig(BaseEnvConfig):
|
|
7
|
-
_title = "Pollinations Configuration"
|
|
8
|
-
_aliases = ["pollinations", "poll"]
|
|
9
|
-
_storage_dir = "Pollinations"
|
|
10
|
-
|
|
11
|
-
POLLINATIONS_API_KEY = EnvField("POLLINATIONS_API_KEY", desc="Pollinations API Key (from enter.pollinations.ai)", is_sensitive=True)
|
|
12
|
-
POLLINATIONS_MODEL_ID = EnvField("POLLINATIONS_MODEL_ID", default="flux", desc="Default Pollinations model ID.")
|
|
13
|
-
|
|
14
|
-
@classmethod
|
|
15
|
-
def test(cls):
|
|
16
|
-
print(f"Testing {cls._title}...")
|
|
17
|
-
try:
|
|
18
|
-
print("✅ Config loaded.")
|
|
19
|
-
except Exception as e:
|
|
20
|
-
print(f"❌ Failed: {e}")
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
__all__ = ["PollinationsConfig"]
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"""SiliconFlowConfig env schema."""
|
|
2
|
-
|
|
3
|
-
from .base import BaseEnvConfig, EnvField
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class SiliconFlowConfig(BaseEnvConfig):
|
|
7
|
-
_title = "SiliconFlow Configuration"
|
|
8
|
-
_aliases = ["siliconflow"]
|
|
9
|
-
_storage_dir = "SiliconFlow"
|
|
10
|
-
|
|
11
|
-
SILICONFLOW_API_KEY = EnvField("SILICONFLOW_API_KEY", desc="SiliconFlow API Key. See https://cloud.siliconflow.cn/account/ak", is_sensitive=True)
|
|
12
|
-
SILICONFLOW_MODEL_ID = EnvField("SILICONFLOW_MODEL_ID", default="black-forest-labs/FLUX.1-schnell", desc="Default Image Model ID. Use `chattool image siliconflow list-models` to see available models.")
|
|
13
|
-
|
|
14
|
-
@classmethod
|
|
15
|
-
def test(cls):
|
|
16
|
-
print(f"Testing {cls._title}...")
|
|
17
|
-
try:
|
|
18
|
-
if not cls.SILICONFLOW_API_KEY.value:
|
|
19
|
-
print("❌ Failed: SILICONFLOW_API_KEY not set")
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
# Simple test to check if key is valid (requires network)
|
|
23
|
-
# For now, just print success if key is present
|
|
24
|
-
print(f"✅ Success! Key configured.")
|
|
25
|
-
except Exception as e:
|
|
26
|
-
print(f"❌ Failed: {e}")
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
__all__ = ["SiliconFlowConfig"]
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"""TongyiConfig env schema."""
|
|
2
|
-
|
|
3
|
-
from .base import BaseEnvConfig, EnvField
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class TongyiConfig(BaseEnvConfig):
|
|
7
|
-
_title = "Tongyi Wanxiang Configuration"
|
|
8
|
-
_aliases = ["tongyi", "dashscope"]
|
|
9
|
-
_storage_dir = "Tongyi"
|
|
10
|
-
|
|
11
|
-
DASHSCOPE_API_KEY = EnvField("DASHSCOPE_API_KEY", desc="Aliyun DashScope API Key. See https://bailian.console.aliyun.com/cn-beijing/?tab=model#/api-key", is_sensitive=True)
|
|
12
|
-
|
|
13
|
-
@classmethod
|
|
14
|
-
def test(cls):
|
|
15
|
-
print(f"Testing {cls._title}...")
|
|
16
|
-
try:
|
|
17
|
-
# 简单验证 key 是否存在
|
|
18
|
-
if not cls.DASHSCOPE_API_KEY.value:
|
|
19
|
-
print("❌ Failed: DASHSCOPE_API_KEY not set")
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
# 尝试导入并调用
|
|
23
|
-
from chattool.tools.image.tongyi import TongyiImageGenerator
|
|
24
|
-
# 注意:这里我们不真正生成图片,因为那会消耗额度且较慢,
|
|
25
|
-
# 我们可以尝试初始化 Client,如果 key 格式不对通常会在使用时报错。
|
|
26
|
-
# 由于 Tongyi 的 SDK 也是惰性的,这里主要检查 import 和 key 存在。
|
|
27
|
-
client = TongyiImageGenerator(api_key=cls.DASHSCOPE_API_KEY.value)
|
|
28
|
-
print(f"✅ Success! Client initialized with key: {cls.DASHSCOPE_API_KEY.mask_value()}")
|
|
29
|
-
except Exception as e:
|
|
30
|
-
print(f"❌ Failed: {e}")
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
__all__ = ["TongyiConfig"]
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
from .base import ImageGenerator
|
|
2
|
-
from .tongyi import TongyiImageGenerator
|
|
3
|
-
from .huggingface import HuggingFaceImageGenerator
|
|
4
|
-
from .liblib import LiblibImageGenerator
|
|
5
|
-
from .pollinations import PollinationsImageGenerator
|
|
6
|
-
from .siliconflow import SiliconFlowImageGenerator
|
|
7
|
-
from .codex import CodexImageGenerator
|
|
8
|
-
|
|
9
|
-
__all__ = [
|
|
10
|
-
"ImageGenerator",
|
|
11
|
-
"TongyiImageGenerator",
|
|
12
|
-
"HuggingFaceImageGenerator",
|
|
13
|
-
"LiblibImageGenerator",
|
|
14
|
-
"PollinationsImageGenerator",
|
|
15
|
-
"SiliconFlowImageGenerator",
|
|
16
|
-
"CodexImageGenerator",
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
def create_generator(provider: str, **kwargs) -> ImageGenerator:
|
|
20
|
-
"""
|
|
21
|
-
Factory function to create an image generator instance.
|
|
22
|
-
|
|
23
|
-
Args:
|
|
24
|
-
provider (str): 'tongyi', 'huggingface', 'liblib', 'pollinations',
|
|
25
|
-
'siliconflow', 'codex', or 'openai-codex'
|
|
26
|
-
**kwargs: Additional config (api_key, etc.)
|
|
27
|
-
|
|
28
|
-
Returns:
|
|
29
|
-
ImageGenerator: The initialized generator.
|
|
30
|
-
"""
|
|
31
|
-
if provider == "tongyi":
|
|
32
|
-
return TongyiImageGenerator(**kwargs)
|
|
33
|
-
elif provider == "huggingface":
|
|
34
|
-
return HuggingFaceImageGenerator(**kwargs)
|
|
35
|
-
elif provider == "liblib":
|
|
36
|
-
return LiblibImageGenerator(**kwargs)
|
|
37
|
-
elif provider == "pollinations":
|
|
38
|
-
return PollinationsImageGenerator(**kwargs)
|
|
39
|
-
elif provider == "siliconflow":
|
|
40
|
-
return SiliconFlowImageGenerator(**kwargs)
|
|
41
|
-
elif provider in {"codex", "openai-codex"}:
|
|
42
|
-
return CodexImageGenerator(**kwargs)
|
|
43
|
-
|
|
44
|
-
else:
|
|
45
|
-
raise ValueError(f"Unknown provider: {provider}")
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import Optional, Any
|
|
3
|
-
|
|
4
|
-
class ImageGenerator(ABC):
|
|
5
|
-
"""
|
|
6
|
-
Abstract base class for all image generation tools.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
@abstractmethod
|
|
10
|
-
def generate(self, prompt: str, **kwargs) -> Any:
|
|
11
|
-
"""
|
|
12
|
-
Generate an image from the given prompt.
|
|
13
|
-
|
|
14
|
-
Args:
|
|
15
|
-
prompt (str): The text description for the image.
|
|
16
|
-
**kwargs: Additional parameters specific to the implementation (e.g. style, size).
|
|
17
|
-
|
|
18
|
-
Returns:
|
|
19
|
-
Any: The result object (e.g. image URL, bytes, or file path).
|
|
20
|
-
"""
|
|
21
|
-
pass
|
|
22
|
-
|
|
23
|
-
def get_models(self) -> list:
|
|
24
|
-
"""
|
|
25
|
-
Get available models for image generation.
|
|
26
|
-
|
|
27
|
-
Returns:
|
|
28
|
-
list: A list of available model IDs or objects.
|
|
29
|
-
"""
|
|
30
|
-
return []
|