MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / refusal

Function refusal

tests/lib/test_refusal_fallback.py:61–71  ·  view source on GitHub ↗
(model: str, fallback_credit_token: str | None = None)

Source from the content-addressed store, hash-verified

59
60
61def refusal(model: str, fallback_credit_token: str | None = None) -> httpx2.Response:
62 return message(
63 model,
64 stop_reason="refusal",
65 stop_details={
66 "type": "refusal",
67 "category": None,
68 "explanation": None,
69 "fallback_credit_token": fallback_credit_token,
70 },
71 )
72
73
74def error(status: int) -> httpx2.Response:

Calls 1

messageFunction · 0.85

Tested by

no test coverage detected