AS AgentScopeAPI 手册 / API Reference
模型与向量化Models & embeddings · 单元Unit 03

模型边界:ChatModel、Formatter 与凭证Model boundary: ChatModel, Formatter and credentials

模型层把各家协议收敛为统一输入输出。学完本单元,你能定位一次模型调用失败到底是凭证、请求格式、参数还是重试策略的问题。The model layer normalizes vendor protocols into unified input and output. After this unit you can tell whether a failed call is caused by credentials, request formatting, parameters or retry policy.

10 道题questions 5 张概念卡concept cards 2 个相关事故related incidents

学习目标Learning goals

  • 区分模型、格式化器与凭证的职责Separate model, formatter and credential responsibilities
  • 理解流式输出与结构化输出的接入方式Understand streaming and structured-output integration
  • 为模型调用配置超时、重试与降级Configure timeouts, retries and fallbacks for model calls

概念闪卡Concept cards

点击卡片翻面查看解释。Click a card to flip it and reveal the explanation.

关键 APIKey APIs

点击进入对应的 Python 或 Java 参考页。Open the exact Python or Java reference for each type.

问题巩固Check yourself

完成 10 道题;答错会自动进入错题本。Answer all ten questions. Wrong answers are added to your wrong-answer book automatically.

01Python 聊天模型的公共基类是?What is the common base class for Python chat models?
02Formatter 的核心职责是什么?What is the formatter responsible for?
03接入 OpenAI 兼容协议时应使用哪个格式化器?Which formatter should you use for OpenAI-compatible protocols?
04Java 侧模型能力的统一接口是?What is the unified Java model interface?
05Java 中配置超时、重试次数与退避策略使用?Which Java type configures timeouts, attempts and backoff?
06按配置创建厂商凭证的工厂类是?Which factory creates vendor credentials from configuration?
07Python 中请求结构化输出的方法是?Which Python method requests structured output?
08Java 中判断模型是否原生支持结构化输出的方法是?How does Java check native structured-output support?
09记录输入、输出与缓存 token 的类型是?Which type records input, output and cached tokens?
10模型超时与重试逻辑最适合放在哪里?Where do model timeouts and retries belong?

接着看的生产事故Production incidents to read next

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.