Skip to content

Commit

Permalink
add info about current model and provider to status
Browse files Browse the repository at this point in the history
  • Loading branch information
GiGurra committed Jun 24, 2024
1 parent 9ae7312 commit be950ea
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 51,21 @@ type StoredConfig struct {
Anthropic anthropic_provider.Config `yaml:"anthropic"`
}

func (s StoredConfig) Model() string {
switch s.Provider {
case "openai":
return s.OpenAI.Model
case "google-cloud":
return s.GoogleCloud.ModelId
case "google-ai-studio":
return s.GoogleAiStudio.ModelId
case "anthropic":
return s.Anthropic.Model
default:
return ""
}
}

type Config struct {
StoredConfig
Verbose bool
Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 182,10 @@ func statusCmd() *cobra.Command {
Short: "Prints info about current session",
Params: &p,
Run: func(cmd *cobra.Command, args []string) {
_, cfgInFile := config.LoadCfgFile()
s := session.LoadSession(session.GetSessionID(p.Session.GetOrElse("")))
fmt.Printf("current provider: %s\n", cfgInFile.Provider)
fmt.Printf("current model: %s\n", cfgInFile.Model())
fmt.Printf("config file: %s\n", config.CfgFilePath())
fmt.Printf("storage dir: %s\n", session.Dir())
fmt.Printf("lookup dir: %s\n", session.LookupDir())
Expand Down

0 comments on commit be950ea

Please sign in to comment.