Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ go test ./internal/domain/categorizer/... -v # single package
Reads `config.yaml` or env vars:
- `MONARCH_TOKEN` — Monarch API token (required)
- LLM categorizer — set **one** of:
- `OPENAI_API_KEY` (also `OPENAI_APIKEY`) with optional `OPENAI_MODEL` (default `gpt-5.4-nano`)
- `ANTHROPIC_API_KEY` (also `CLAUDE_API_KEY`) with optional `ANTHROPIC_MODEL` (default `claude-haiku-4-5-20251001`)
- `OPENAI_API_KEY` (also `OPENAI_APIKEY`) with optional `OPENAI_MODEL` (default `gpt-5.6-luna`)
- `ANTHROPIC_API_KEY` (also `CLAUDE_API_KEY`) with optional `ANTHROPIC_MODEL` (default `claude-haiku-4-5`)
- `CATEGORIZER_PROVIDER` — `openai` or `anthropic` to force a backend when both keys are set (auto-detected otherwise)
- SQLite DB auto-created at `monarch_sync.db`

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ monarch:

openai:
api_key: "${OPENAI_API_KEY}"
model: "gpt-5.4-nano"
model: "gpt-5.6-luna"

anthropic:
api_key: "${ANTHROPIC_API_KEY}"
model: "claude-haiku-4-5-20251001"
model: "claude-haiku-4-5"

# Optional: force a backend when both keys are set.
# Leave blank to auto-detect from whichever key is present.
Expand Down
4 changes: 2 additions & 2 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ monarch:
# OpenAI configuration
openai:
api_key: "${OPENAI_API_KEY}"
model: "gpt-5.4-nano"
model: "gpt-5.6-luna"

# Anthropic (Claude) configuration — used when CATEGORIZER_PROVIDER=anthropic
# or when ANTHROPIC_API_KEY is the only LLM key set.
anthropic:
api_key: "${ANTHROPIC_API_KEY}"
model: "claude-haiku-4-5-20251001"
model: "claude-haiku-4-5"

# Categorizer backend selection.
# Leave provider empty to auto-detect from which API key is set.
Expand Down
4 changes: 2 additions & 2 deletions internal/adapters/clients/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import (
"log/slog"
"strings"

"github.com/eshaffer321/monarch-go/v2/pkg/monarch"
anthropicclient "github.com/eshaffer321/itemize/internal/adapters/clients/anthropic"
openaiclient "github.com/eshaffer321/itemize/internal/adapters/clients/openai"
"github.com/eshaffer321/itemize/internal/domain/categorizer"
"github.com/eshaffer321/itemize/internal/infrastructure/config"
"github.com/eshaffer321/monarch-go/v2/pkg/monarch"
)

const (
providerOpenAI = "openai"
providerAnthropic = "anthropic"
defaultAnthropicModel = "claude-haiku-4-5-20251001"
defaultAnthropicModel = "claude-haiku-4-5"
)

type Clients struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/domain/categorizer/categorizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func NewCategorizer(client ChatClient, cache Cache, model string) *Categorizer {
}
}

const DefaultModel = "gpt-5.4-nano"
const DefaultModel = "gpt-5.6-luna"

// CategorizeItems categorizes a list of items using available categories
func (c *Categorizer) CategorizeItems(ctx context.Context, items []Item, categories []Category) (*CategorizationResult, error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/domain/categorizer/categorizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,5 +423,5 @@ func TestCategorizer_CategorizeItems_ExhaustsRetries(t *testing.T) {
func TestNewCategorizer_DefaultsModelWhenEmpty(t *testing.T) {
categorizer := NewCategorizer(new(MockChatClient), new(MockCache), "")

assert.Equal(t, "gpt-5.4-nano", categorizer.Model)
assert.Equal(t, DefaultModel, categorizer.Model)
}
4 changes: 2 additions & 2 deletions internal/infrastructure/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ func LoadFromEnv() *Config {
},
OpenAI: OpenAIConfig{
APIKey: os.Getenv("OPENAI_API_KEY"),
Model: getEnv("OPENAI_MODEL", "gpt-5.4-nano"),
Model: getEnv("OPENAI_MODEL", "gpt-5.6-luna"),
},
Anthropic: AnthropicConfig{
APIKey: firstNonEmpty(os.Getenv("ANTHROPIC_API_KEY"), os.Getenv("CLAUDE_API_KEY")),
Model: getEnv("ANTHROPIC_MODEL", "claude-haiku-4-5-20251001"),
Model: getEnv("ANTHROPIC_MODEL", "claude-haiku-4-5"),
},
Categorizer: CategorizerConfig{
Provider: os.Getenv("CATEGORIZER_PROVIDER"),
Expand Down
4 changes: 2 additions & 2 deletions internal/infrastructure/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestLoadFromYAML(t *testing.T) {
require.NoError(t, err)
assert.NotNil(t, cfg)
assert.Equal(t, "monarch_sync.db", cfg.Storage.DatabasePath)
assert.Equal(t, "gpt-5.4-nano", cfg.OpenAI.Model)
assert.Equal(t, "gpt-5.6-luna", cfg.OpenAI.Model)
}

func TestLoadFromEnv(t *testing.T) {
Expand Down Expand Up @@ -66,7 +66,7 @@ func TestLoadFromEnv_Defaults(t *testing.T) {
cfg := LoadFromEnv()
assert.NotNil(t, cfg)
assert.Equal(t, "monarch_sync.db", cfg.Storage.DatabasePath)
assert.Equal(t, "gpt-5.4-nano", cfg.OpenAI.Model)
assert.Equal(t, "gpt-5.6-luna", cfg.OpenAI.Model)
}

func TestLoadOrEnv(t *testing.T) {
Expand Down