顾问工具现在支持max_tokens参数,用于限制每次调用时顾问模型的输出长度,从而减少不需要完整顾问响应的任务的延迟和输出token成本。在顾问工具定义中设置tools[].max_tokens;参见《限制顾问输出》。在Claude API中,当请求返回stop_reason: "refusal"且Claude未生成任何输出时,您将不再被计费。参见《流式拒绝》以检测和处理拒绝情况。
The advisor tool now supports a max_tokens parameter to cap the advisor model's output per call, reducing latency and output token cost for workloads that don't need full-length advisor responses. Set tools[].max_tokens on the advisor tool definition; see Capping advisor output. On the Claude API, you are no longer billed for a request when it returns stop_reason: "refusal" without Claude having generated any output. See Streaming refusals for detecting and handling refusals.
本文内容采集自官方网站,排版和翻译可能与原页面存在差异。
阅读官方全文