Classification prompt builder implementation.
More...
#include <entropic/prompts/classification.h>
#include <entropic/types/logging.h>
#include <algorithm>
#include <cctype>
Go to the source code of this file.
|
| namespace | entropic |
| | Activate model on GPU (WARM → ACTIVE).
|
| |
Classification prompt builder implementation.
- Version
- 1.8.1
Definition in file classification.cpp.
◆ build_classification_prompt()
| std::string entropic::prompts::build_classification_prompt |
( |
const std::vector< TierDescriptor > & |
tiers, |
|
|
const std::string & |
message, |
|
|
const std::vector< std::string > & |
history = {}, |
|
|
const std::vector< std::string > & |
recent_tiers = {} |
|
) |
| |
Auto-generate classification prompt from tier focus + examples.
The trailing " -> " (with space) constrains the router model to output a single digit. Used with max_tokens=1 for classification.
- Parameters
-
| tiers | Ordered tiers (index+1 = classification digit). |
| message | User message to classify. |
| history | Recent user messages for context (optional). |
| recent_tiers | Recent tier activations for continuity (optional). |
- Returns
- Classification prompt string.
- Version
- 1.8.1
- Parameters
-
| tiers | Ordered tiers (index+1 = classification digit). |
| message | User message to classify. |
| history | Recent user messages for context. |
| recent_tiers | Recent tier activations for continuity. |
- Returns
- Classification prompt string.
- Version
- 2.0.0
Definition at line 125 of file classification.cpp.
◆ format_tier_definitions()
| static std::string entropic::prompts::format_tier_definitions |
( |
const std::vector< TierDescriptor > & |
tiers | ) |
|
|
static |
Build tier definition lines for classification prompt.
- Parameters
-
- Returns
- Formatted tier definitions.
- Version
- 1.8.2
Definition at line 103 of file classification.cpp.
◆ interleave_examples()
| std::vector< std::string > entropic::prompts::interleave_examples |
( |
const std::vector< TierDescriptor > & |
tiers | ) |
|
Round-robin interleave few-shot examples across tiers.
Cycling through tiers prevents recency bias — no single tier's examples dominate the tail of the prompt. The 0.6B router model is sensitive to example ordering.
- Parameters
-
| tiers | Ordered tiers (index+1 = classification digit). |
- Returns
- Lines formatted as: "example text" -> digit
- Version
- 1.8.1
- Parameters
-
| tiers | Ordered tiers (index+1 = classification digit). |
- Returns
- Lines formatted as: "example text" -> digit
- Version
- 1.8.1
Definition at line 41 of file classification.cpp.
◆ join()
| static std::string entropic::prompts::join |
( |
const std::vector< std::string > & |
items, |
|
|
const std::string & |
sep |
|
) |
| |
|
static |
Join strings with a separator.
- Parameters
-
| items | Strings to join. |
| sep | Separator between items. |
- Returns
- Joined string.
- Version
- 1.8.2
Definition at line 85 of file classification.cpp.
◆ to_upper()
| static std::string entropic::prompts::to_upper |
( |
const std::string & |
s | ) |
|
|
static |
Convert string to uppercase.
- Parameters
-
- Returns
- Uppercase version.
- Version
- 1.8.1
Definition at line 26 of file classification.cpp.