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 the refusal.
14
15 `null` when the refusal doesn't map to a named category.
16
17 - `cyber` - The request could enable cyber harm, such as malware or exploit
18 development. Benign cybersecurity work can also trigger this category.
19 - `bio` - The request could enable biological harm, such as dangerous lab
20 methods. Beneficial life sciences work can also trigger this category.
21 - `frontier_llm` - The request could assist the development of competing AI
22 models, which is restricted under
23 [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms).
24 Benign machine learning work can also trigger this category.
25 - `reasoning_extraction` - The request asks the model to reproduce its internal
26 reasoning in the response text. To get reasoning in a structured form instead,
27 use
28 [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking).
29 - `general_harms` - The request could be related to an area that was determined
30 as harmful. Benign work might sometimes trigger this category.
31 """
32
33 explanation: Optional[str] = None
34 """Human-readable explanation of the refusal.
35
36 This text is not guaranteed to be stable. `null` when no explanation is
37 available for the category.
38 """
39
40 type: Literal["refusal"]