refusal_from_status_error#
Connect a provider and configure retries, credentials, and transport. See the guide.
- zett_agent.providers.stop_reasons.refusal_from_status_error(status_code, body)[源代码]#
Return the refusal an HTTP error response describes, or None when it is something else.
Recognized, and only these:
400withtypeorcodecontent_filter(Kimi: "considered high risk").403withmetadata.reasons(an OpenRouter moderation flag) ormetadata.patterns(an OpenRouter guardrail). A budget or permission403has other metadata and stays an error.
- 参数:
status_code (int) -- The HTTP status.
body (object) -- The
errorobject of the response body, as the SDK exposes it.
- 返回类型:
StopInfo | None