Open source AI coding agent. Designed for large projects and real world tasks.
Go aiai-agentsai-developer-toolsai-toolsclicommand-linedeveloper-toolsgitgolanggpt-4llmopenaipolyglot-programmingterminalterminal-basedterminal-ui
docs: update model documentation and miscellaneous improvements
Dane Schneider3c641d220b25
diff --git a/app/cli/cmd/credits_log.go b/app/cli/cmd/credits_log.goindex c93b5574..fe48b4cc 100644--- a/app/cli/cmd/credits_log.go+++ b/app/cli/cmd/credits_log.go@@ -74,12 +74,28 @@ func creditsLog(cmd *cobra.Command, args []string) {inputPrice := transaction.DebitModelInputPricePerToken.Mul(decimal.NewFromInt(1000000)).Mul(surchargePct.Add(decimal.NewFromInt(1))).StringFixed(4)outputPrice := transaction.DebitModelOutputPricePerToken.Mul(decimal.NewFromInt(1000000)).Mul(surchargePct.Add(decimal.NewFromInt(1))).StringFixed(4)+ var cacheDiscountStr string+ var cacheDiscountPct float64+ if transaction.DebitCacheDiscount != nil {+ cacheDiscountStr = transaction.DebitCacheDiscount.StringFixed(4)+ totalAmount := transaction.DebitBaseAmount.Add(*transaction.DebitCacheDiscount)+ cacheDiscountPct = transaction.DebitCacheDiscount.Div(totalAmount).Mul(decimal.NewFromInt(100)).InexactFloat64()+ }+for i := 0; i < 2; i++ {inputPrice = strings.TrimSuffix(inputPrice, "0")outputPrice = strings.TrimSuffix(outputPrice, "0")+ cacheDiscountStr = strings.TrimSuffix(cacheDiscountStr, "0")}- desc += fmt.Sprintf("⚡️ %s\n🧠 %s/%s\n💳 Price → $%s input / $%s output per 1M\n🪙 Used → %d input / %d output\n", *transaction.DebitPurpose, string(*transaction.DebitModelProvider), *transaction.DebitModelName, inputPrice, outputPrice, *transaction.DebitInputTokens, *transaction.DebitOutputTokens)+ desc += fmt.Sprintf("⚡️ %s\n", *transaction.DebitPurpose)+ desc += fmt.Sprintf("🧠 %s/%s\n", string(*transaction.DebitModelProvider), *transaction.DebitModelName)+ desc += fmt.Sprintf("💳 Price → $%s input / $%s output per 1M\n", inputPrice, outputPrice)+ desc += fmt.Sprintf("🪙 Used → %d input / %d output\n", *transaction.DebitInputTokens, *transaction.DebitOutputTokens)++ if cacheDiscountStr != "" {+ desc += fmt.Sprintf("🎯 Cache discount → $%s (%d%%)\n", cacheDiscountStr, int(cacheDiscountPct))+ }} else {sign = "+"diff --git a/app/cli/format/time.go b/app/cli/format/time.goindex a569573d..39db9ea0 100644--- a/app/cli/format/time.go+++ b/app/cli/format/time.go@@ -40,23 +40,23 @@ func Time(then time.Time) string {// DivBy should be time.Minute so whatever the duration is will be// expressed in minutes.type relTimeMagnitude struct {- D time.Duration- Format string- DivBy time.Duration+ D time.Duration+ Fn func(diff time.Duration, lbl string) string+ DivBy time.Duration}var defaultMagnitudes = []relTimeMagnitude{- {time.Second, "just now", time.Second},- {2 * time.Second, "1s %s", 1},- {time.Minute, "%ds %s", time.Second},- {2 * time.Minute, "1m %s", 1},- {time.Hour, "%dm %s", time.Minute},- {2 * time.Hour, "1h %s", 1},- {Day, "%dh %s", time.Hour},- {2 * Day, "1d %s", 1},- {Week, "%dd %s", Day},- {2 * Week, "1w %s", 1},- {Month, "%dw %s", Week},+ {time.Second, func(diff time.Duration, lbl string) string { return "just now" }, time.Second},+ {2 * time.Second, func(diff time.Duration, lbl string) string { return fmt.Sprintf("1s %s", lbl) }, 1},+ {time.Minute, func(diff time.Duration, lbl string) string { return fmt.Sprintf("%ds %s", diff, lbl) }, time.Second},+ {2 * time.Minute, func(diff time.Duration, lbl string) string { return fmt.Sprintf("1m %s", lbl) }, 1},+ {time.Hour, func(diff time.Duration, lbl string) string { return fmt.Sprintf("%dm %s", diff, lbl) }, time.Minute},+ {2 * time.Hour, func(diff time.Duration, lbl string) string { return fmt.Sprintf("1h %s", lbl) }, 1},+ {Day, func(diff time.Duration, lbl string) string { return fmt.Sprintf("%dh %s", diff, lbl) }, time.Hour},+ {2 * Day, func(diff time.Duration, lbl string) string { return fmt.Sprintf("1d %s", lbl) }, 1},+ {Week, func(diff time.Duration, lbl string) string { return fmt.Sprintf("%dd %s", diff, lbl) }, Day},+ {2 * Week, func(diff time.Duration, lbl string) string { return fmt.Sprintf("1w %s", lbl) }, 1},+ {Month, func(diff time.Duration, lbl string) string { return fmt.Sprintf("%dw %s", diff, lbl) }, Week},}// RelTime(timeInPast, timeInFuture, "earlier", "later") -> "3 weeks earlier"@@ -92,8 +92,8 @@ func customRelTime(a, b time.Time, albl, blbl string, magnitudes []relTimeMagnitmag := magnitudes[n]if mag.DivBy == 1 {- return fmt.Sprintf(mag.Format, lbl)+ return mag.Fn(diff, lbl)}- return fmt.Sprintf(mag.Format, diff/mag.DivBy, lbl)+ return mag.Fn(diff/mag.DivBy, lbl)}diff --git a/docs/docs/models/model-settings.md b/docs/docs/models/model-settings.mdindex 38ed3157..5e6913c7 100644--- a/docs/docs/models/model-settings.md+++ b/docs/docs/models/model-settings.md@@ -15,7 +15,7 @@ You can see the current plan's models and model settings with the `models` commaplandex models # show the current AI models and model settingsplandex models available # show all available modelsplandex set-model # select from a list of models and settings-plandex set-model planner openrouter/anthropic/claude-3.5-sonnet # set the main planner model to Claude Sonnet 3.5 from OpenRouter.ai+plandex set-model planner openrouter/anthropic/claude-3.7-sonnet # set the main planner model to Claude Sonnet 3.5 from OpenRouter.aiplandex set-model builder temperature 0.1 # set the builder model's temperature to 0.1plandex set-model max-tokens 4000 # set the planner model overall token limit to 4000plandex set-model max-convo-tokens 20000 # set how large the conversation can grow before Plandex starts using summaries