docs: refine ModelScope documentation wording

This commit is contained in:
yrk
2026-07-22 01:35:20 +08:00
committed by Xubin Ren
parent 9abad4746e
commit be1cc769d5
4 changed files with 24 additions and 12 deletions
+2 -2
View File
@@ -254,7 +254,7 @@ Tracing covers the providers that go through nanobot's OpenAI-compatible client
> - **OpenCode Zen / Go**: `providers.opencode` (canonical Zen), the legacy-compatible `providers.opencodeZen`, and `providers.opencodeGo` use the same `OPENCODE_API_KEY`, but route to different OpenCode gateways. These providers use OpenCode's OpenAI-compatible `chat/completions` endpoints; choose model IDs from that endpoint family. > - **OpenCode Zen / Go**: `providers.opencode` (canonical Zen), the legacy-compatible `providers.opencodeZen`, and `providers.opencodeGo` use the same `OPENCODE_API_KEY`, but route to different OpenCode gateways. These providers use OpenCode's OpenAI-compatible `chat/completions` endpoints; choose model IDs from that endpoint family.
> - **Zhipu Coding Plan**: If you're on Zhipu's coding plan, set `"apiBase": "https://open.bigmodel.cn/api/coding/paas/v4"` in your zhipu provider config. > - **Zhipu Coding Plan**: If you're on Zhipu's coding plan, set `"apiBase": "https://open.bigmodel.cn/api/coding/paas/v4"` in your zhipu provider config.
> - **Alibaba Cloud BaiLian**: If you're using Alibaba Cloud BaiLian's OpenAI-compatible endpoint, set `"apiBase": "https://dashscope.aliyuncs.com/compatible-mode/v1"` in your dashscope provider config. > - **Alibaba Cloud BaiLian**: If you're using Alibaba Cloud BaiLian's OpenAI-compatible endpoint, set `"apiBase": "https://dashscope.aliyuncs.com/compatible-mode/v1"` in your dashscope provider config.
> - **ModelScope (魔搭社区)**: If you're using ModelScope's OpenAI-compatible endpoint, set `"apiBase": "https://api-inference.modelscope.cn/v1"` in your modelscope provider config. > - **ModelScope**: If you're using ModelScope's OpenAI-compatible endpoint, set `"apiBase": "https://api-inference.modelscope.cn/v1"` in your modelscope provider config.
> - **StepFun Step Plan**: If you're on StepFun's Step Plan subscription, set `"apiBase": "https://api.stepfun.ai/step_plan/v1"` in your stepfun provider config. Supported models include `step-3.5-flash`, `step-3.5-flash-2603`, and `step-router-v1`. > - **StepFun Step Plan**: If you're on StepFun's Step Plan subscription, set `"apiBase": "https://api.stepfun.ai/step_plan/v1"` in your stepfun provider config. Supported models include `step-3.5-flash`, `step-3.5-flash-2603`, and `step-router-v1`.
> - **Step Fun (Mainland China)**: If your API key is from Step Fun's mainland China platform (stepfun.com), set `"apiBase": "https://api.stepfun.com/v1"` in your stepfun provider config. > - **Step Fun (Mainland China)**: If your API key is from Step Fun's mainland China platform (stepfun.com), set `"apiBase": "https://api.stepfun.com/v1"` in your stepfun provider config.
> - **Xiaomi MiMo thinking mode**: MiMo models (e.g. `mimo-v2.5-pro`) default to enabled thinking. Use `agents.defaults.reasoningEffort: "none"` to disable it, or `"low"` / `"medium"` / `"high"` to keep it on. Omitting the field preserves the provider's per-model default. > - **Xiaomi MiMo thinking mode**: MiMo models (e.g. `mimo-v2.5-pro`) default to enabled thinking. Use `agents.defaults.reasoningEffort: "none"` to disable it, or `"low"` / `"medium"` / `"high"` to keep it on. Omitting the field preserves the provider's per-model default.
@@ -289,7 +289,7 @@ Tracing covers the providers that go through nanobot's OpenAI-compatible client
| `siliconflow` | LLM (SiliconFlow/硅基流动) | [siliconflow.cn](https://siliconflow.cn) | | `siliconflow` | LLM (SiliconFlow/硅基流动) | [siliconflow.cn](https://siliconflow.cn) |
| `novita` | LLM (Novita AI OpenAI-compatible gateway) | [novita.ai](https://novita.ai) | | `novita` | LLM (Novita AI OpenAI-compatible gateway) | [novita.ai](https://novita.ai) |
| `dashscope` | LLM (Qwen) | [dashscope.console.aliyun.com](https://dashscope.console.aliyun.com) | | `dashscope` | LLM (Qwen) | [dashscope.console.aliyun.com](https://dashscope.console.aliyun.com) |
| `modelscope` | LLM (ModelScope/魔搭) + Image generation | [modelscope.cn](https://modelscope.cn) | | `modelscope` | LLM (ModelScope/魔搭社区) + Image generation | [modelscope.cn](https://modelscope.cn) |
| `moonshot` | LLM (Moonshot/Kimi) | [platform.kimi.com](https://platform.kimi.com?aff=nanobot) | | `moonshot` | LLM (Moonshot/Kimi) | [platform.kimi.com](https://platform.kimi.com?aff=nanobot) |
| `kimi_coding` | LLM (Kimi Coding Plan, Anthropic Messages API) | [platform.kimi.com](https://platform.kimi.com?aff=nanobot) | | `kimi_coding` | LLM (Kimi Coding Plan, Anthropic Messages API) | [platform.kimi.com](https://platform.kimi.com?aff=nanobot) |
| `zhipu` | LLM (Zhipu GLM) | [open.bigmodel.cn](https://open.bigmodel.cn) | | `zhipu` | LLM (Zhipu GLM) | [open.bigmodel.cn](https://open.bigmodel.cn) |
+1 -1
View File
@@ -323,7 +323,7 @@ Other supported models: `cogview-4`, `cogview-4-250304`, `cogview-3-flash`. Refe
ModelScope (魔搭社区) API-Inference supports text-to-image generation and image editing via an async task pattern. ModelScope (魔搭社区) API-Inference supports text-to-image generation and image editing via an async task pattern.
Supported aspect ratios: `1:1`, `16:9`, `9:16`, `3:4`, `4:3`. Sizes can be specified as `WIDTHxHEIGHT` (e.g. `1024x1024`, `1536x1024`) or using aspect ratio presets. Supported aspect ratios: `1:1`, `16:9`, `9:16`, `3:4`, `4:3`. Sizes can be specified as `WIDTHxHEIGHT` (e.g. `1024x1024`, `1664x928`) or using aspect ratio presets.
```json ```json
{ {
+5 -5
View File
@@ -1760,11 +1760,11 @@ _MODELSCOPE_TIMEOUT_S = 300.0
_MODELSCOPE_POLL_INTERVAL_S = 5.0 _MODELSCOPE_POLL_INTERVAL_S = 5.0
_MODELSCOPE_POLL_MAX_ATTEMPTS = 60 # 5 min at 5s intervals _MODELSCOPE_POLL_MAX_ATTEMPTS = 60 # 5 min at 5s intervals
_MODELSCOPE_ASPECT_RATIOS = { _MODELSCOPE_ASPECT_RATIOS = {
"1:1": "1024x1024", "1:1": "1328x1328",
"16:9": "1536x1024", "16:9": "1664x928",
"9:16": "1024x1536", "9:16": "928x1664",
"3:4": "1024x1536", "3:4": "1140x1472",
"4:3": "1536x1024", "4:3": "1472x1140",
} }
+16 -4
View File
@@ -1633,8 +1633,21 @@ async def test_modelscope_image_generation_with_size() -> None:
assert body["size"] == "768x1024" assert body["size"] == "768x1024"
@pytest.mark.parametrize(
("aspect_ratio", "expected_size"),
[
("1:1", "1328x1328"),
("16:9", "1664x928"),
("9:16", "928x1664"),
("3:4", "1140x1472"),
("4:3", "1472x1140"),
],
)
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_modelscope_image_generation_aspect_ratio_mapping() -> None: async def test_modelscope_image_generation_aspect_ratio_mapping(
aspect_ratio: str,
expected_size: str,
) -> None:
submit = FakeResponse({"task_id": "t1"}) submit = FakeResponse({"task_id": "t1"})
poll = [FakeResponse({"task_status": "SUCCEED", "output_images": ["https://cdn/img.png"]})] poll = [FakeResponse({"task_status": "SUCCEED", "output_images": ["https://cdn/img.png"]})]
fake = ModelScopeFakeClient(submit, poll) fake = ModelScopeFakeClient(submit, poll)
@@ -1643,9 +1656,9 @@ async def test_modelscope_image_generation_aspect_ratio_mapping() -> None:
client=fake, # type: ignore[arg-type] client=fake, # type: ignore[arg-type]
) )
await client.generate(prompt="test", model="m", aspect_ratio="16:9") await client.generate(prompt="test", model="m", aspect_ratio=aspect_ratio)
assert fake.calls[0]["json"]["size"] == "1536x1024" assert fake.calls[0]["json"]["size"] == expected_size
@pytest.mark.asyncio @pytest.mark.asyncio
@@ -1753,4 +1766,3 @@ async def test_modelscope_image_generation_poll_timeout(monkeypatch) -> None:
# Should have polled up to the (patched) attempt limit. # Should have polled up to the (patched) attempt limit.
assert len(fake.get_calls) == 3 assert len(fake.get_calls) == 3