Debian Codegraph @

src/anthropic/types/refusal_stop_details.py

raw
1 from typing import Optional
2 from typing_extensions import Literal
3
4 from .._models import BaseModel
5
6 __all__ = ["RefusalStopDetails"]
7
8
9 class RefusalStopDetails(BaseModel):
10 """Structured information about a refusal."""
11
12 category: Optional[Literal["cyber", "bio", "frontier_llm", "reasoning_extraction", "general_harms"]] = None
13 """The policy category that triggered a refusal.
14
15 - `cyber` - The request could enable cyber harm, such as malware or exploit
16 development. Benign cybersecurity work can also trigger this category.
17 - `bio` - The request could enable biological harm, such as dangerous lab
18 methods. Beneficial life sciences work can also trigger this category.
19 - `frontier_llm` - The request could assist the development of competing AI
20 models, which is restricted under
21 [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms).
22 Benign machine learning work can also trigger this category.
23 - `reasoning_extraction` - The request asks the model to reproduce its internal
24 reasoning in the response text. To get reasoning in a structured form instead,
25 use
26 [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking).
27 - `general_harms` - The request could be related to an area that was determined
28 as harmful. Benign work might sometimes trigger this category.
29 """
30
31 explanation: Optional[str] = None
32 """Human-readable explanation of the refusal.
33
34 This text is not guaranteed to be stable. `null` when no explanation is
35 available for the category.
36 """
37
38 type: Literal["refusal"]