根据我的观察,claude code 会用 claude-3-5-haiku 去做两个任务:
可以通过环境变量 `ANTHROPIC_SMALL_FAST_MODEL` 指定模型,默认是 `claude-3-5-haiku`
任务 1:给任务起标题
```json
{
"model": "claude-3-5-haiku",
"stream": true,
"system": [
{
"text": "Summarize this coding conversation in under 50 characters.\nCapture the main task, key files, problems addressed, and current status.",
"type": "text",
"cache_control": {
"type": "ephemeral"
}
}
],
"messages": [
{
"role": "user",
"content": "你的输入"
],
"max_tokens": 512,
"temperature": 0
}
```
任务 2:判断是不是新 topic
```json
{
"model": "claude-3-5-haiku",
"stream": true,
"system": [
{
"text": "Analyze if this message indicates a new conversation topic. If it does, extract a 2-3 word title that captures the new topic. Format your response as a JSON object with two fields: 'isNewTopic' (boolean) and 'title' (string, or null if isNewTopic is false). Only include these fields, no other text.",
"type": "text"
}
],
"messages": [
{
"role": "user",
"content": "你的输入"
}
],
"max_tokens": 512,
"temperature": 0
}
```