Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:27:31 +08:00
commit b3b538c011
38 changed files with 5130 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
# Classification Templates
Templates for classification patterns (sentiment, intent, category, etc.)
## Pattern Structure
Each classification template includes:
- Input types (usually text)
- Enum definitions for categories
- Classification function with confidence
- Reasoning capture
- Example test cases
## Common Use Cases
- Sentiment analysis
- Intent detection
- Category assignment
- Priority classification
- Topic identification

View File

@@ -0,0 +1,35 @@
// Example: Sentiment Classification Pattern
enum Sentiment {
Positive @description("Positive sentiment")
Negative @description("Negative sentiment")
Neutral @description("Neutral sentiment")
}
class SentimentResult {
sentiment Sentiment
confidence float @description("Confidence score 0-1")
reasoning string @description("Explanation for classification")
}
client FastModel {
provider "openai"
options {
model "gpt-4o-mini"
temperature 0.1
}
}
function ClassifySentiment(text: string) -> SentimentResult {
client FastModel
prompt #"
Classify the sentiment of the following text:
{{ text }}
Provide confidence score and reasoning.
{{ ctx.output_format }}
"#
}