MaaS Spec FAQ
约 1 分钟阅读
tags:
- FAQ
常见 Provider
- Google Generative AI API / Gemini API
- Google Vertex AI
- Anthropic
- OpenAI
- xAI
- vLLM / OpenAI compatible servers
错误码
- Google Vertex AI
- Anthropic
- OpenAI
- 华为云 MaaS ModelArts
role 差异
| role | OpenAI | Anthropic |
|---|---|---|
developer | 支持 | 通常需要映射到 system / instruction |
system | 支持 | 支持 system 参数/块 |
user | 支持 | 支持 |
assistant | 支持 | 支持 |
tool | 新版工具结果 role | 通常使用 user role tool result block |
function | 旧版 function calling | 不使用 |
Thinking / Reasoning
- Interleaved thinking
- 思考过程可以进行 tool call。
- Claude 4+ 支持,Messages API 才支持。
- MiniMax-M2、Kimi-K2-Thinking 等模型也有类似能力。
- Preserved thinking
- 智普 GLM 4.7 支持保留思考内容。
- 再生成 chat template 时允许传递之前的思考内容。
- 默认不保持:
clear_thinking: true。 - HF:zai-org/GLM-4.7HuggingFaceHF:zai-org/GLM-4.7huggingface.co · huggingface.co/zai-org/GLM-4.7/blob/main/chat_template.jinja
Reasoning details
reasoning.summaryreasoning.encryptedreasoning.text
相关参考:
- openrouter.ai/docs/guides/best-practices/reasoning-tokens
- docs.vllm.ai/en/latest/features/interleaved_thinking
- docs.bigmodel.cn/cn/guide/capabilities/thinking-mode
API 行为兼容注意
- Streaming chunk 结构、usage 时机、finish reason 位置存在供应商差异。
- Tool call schema、tool choice、tool result role 存在供应商差异。
- Prompt cache 最小 token、TTL、折扣和 usage 字段存在供应商差异。
- Abort / timeout 时 usage 可能不可得,但请求仍可能产生费用。
关联信息
反向链接、本文链接的其他页面和外部资料。
反向链接
- MaaS API Spec笔记 · spec-faq
Session / Thread · Turn · Message · Message Part / Content Part · Chunk Part · | topic | for | · | google | Gemini API、Vertex AI、Google tools / thinking / cache |
参考资料
HuggingFace1 条
- HF:zai-org/GLM-4.7huggingface.co/zai-org/GLM-4.7/blob/main/chat_template.jinja
其他外链7 条
- docs.bigmodel.cn/cn/guide/capabilities/thinking-modedocs.bigmodel.cn/cn/guide/capabilities/thinking-mode
- docs.cloud.google.com/vertex-ai/generative-ai/docs/model-reference/api-errorsdocs.cloud.google.com/vertex-ai/generative-ai/docs/model-reference/api-errors
- docs.vllm.ai/en/latest/features/interleaved_thinkingdocs.vllm.ai/en/latest/features/interleaved_thinking
- openrouter.ai/docs/guides/best-practices/reasoning-tokensopenrouter.ai/docs/guides/best-practices/reasoning-tokens
- platform.claude.com/docs/en/api/errorsplatform.claude.com/docs/en/api/errors
- platform.openai.com/docs/guides/error-codesplatform.openai.com/docs/guides/error-codes
- support.huaweicloud.com/usermanual-maas-modelarts/maas-modelarts-0080.htmlsupport.huaweicloud.com/usermanual-maas-modelarts/maas-modelarts-0080.html