on main help sign in
chore: small update
ce29825Kujtim Hoxha
internal/config/load.go+6
@@ -145,6 +145,9 @@ func (cfg *Config) configureProviders(env env.Env, resolver VariableResolver, kn
145 continue
145 continue
146 }
146 }
147 seen[model.ID] = true
147 seen[model.ID] = true
148+ if model.Model == "" {
149+ model.Model = model.ID
150+ }
148 models = append(models, model)
151 models = append(models, model)
149 }
152 }
150 for _, model := range p.Models {
153 for _, model := range p.Models {
@@ -152,6 +155,9 @@ func (cfg *Config) configureProviders(env env.Env, resolver VariableResolver, kn
152 continue
155 continue
153 }
156 }
154 seen[model.ID] = true
157 seen[model.ID] = true
158+ if model.Model == "" {
159+ model.Model = model.ID
160+ }
155 models = append(models, model)
161 models = append(models, model)
156 }
162 }
157
163
internal/config/load_test.go+3−3
@@ -98,8 +98,8 @@ func TestConfig_configureProvidersWithOverride(t *testing.T) {
98 BaseURL: "https://api.openai.com/v2",
98 BaseURL: "https://api.openai.com/v2",
99 Models: []provider.Model{
99 Models: []provider.Model{
100 {
100 {
101− ID: "test-model",
101+ ID: "test-model",
102− Name: "Updated",
102+ Model: "Updated",
103 },
103 },
104 {
104 {
105 ID: "another-model",
105 ID: "another-model",
@@ -122,7 +122,7 @@ func TestConfig_configureProvidersWithOverride(t *testing.T) {
122 assert.Equal(t, "xyz", cfg.Providers["openai"].APIKey)
122 assert.Equal(t, "xyz", cfg.Providers["openai"].APIKey)
123 assert.Equal(t, "https://api.openai.com/v2", cfg.Providers["openai"].BaseURL)
123 assert.Equal(t, "https://api.openai.com/v2", cfg.Providers["openai"].BaseURL)
124 assert.Len(t, cfg.Providers["openai"].Models, 2)
124 assert.Len(t, cfg.Providers["openai"].Models, 2)
125− assert.Equal(t, "Updated", cfg.Providers["openai"].Models[0].Name)
125+ assert.Equal(t, "Updated", cfg.Providers["openai"].Models[0].Model)
126}
126}
127
127
128func TestConfig_configureProvidersWithNewProvider(t *testing.T) {
128func TestConfig_configureProvidersWithNewProvider(t *testing.T) {
internal/fur/provider/provider.go+1−1
@@ -45,7 +45,7 @@ type Provider struct {
45// Model represents an AI model configuration.
45// Model represents an AI model configuration.
46type Model struct {
46type Model struct {
47 ID string `json:"id"`
47 ID string `json:"id"`
48− Name string `json:"model"`
48+ Model string `json:"model"`
49 CostPer1MIn float64 `json:"cost_per_1m_in"`
49 CostPer1MIn float64 `json:"cost_per_1m_in"`
50 CostPer1MOut float64 `json:"cost_per_1m_out"`
50 CostPer1MOut float64 `json:"cost_per_1m_out"`
51 CostPer1MInCached float64 `json:"cost_per_1m_in_cached"`
51 CostPer1MInCached float64 `json:"cost_per_1m_in_cached"`
internal/tui/components/chat/messages/messages.go+1−1
@@ -296,7 +296,7 @@ func (m *assistantSectionModel) View() string {
296 infoMsg := t.S().Subtle.Render(duration.String())
296 infoMsg := t.S().Subtle.Render(duration.String())
297 icon := t.S().Subtle.Render(styles.ModelIcon)
297 icon := t.S().Subtle.Render(styles.ModelIcon)
298 model := config.Get().GetModel(m.message.Provider, m.message.Model)
298 model := config.Get().GetModel(m.message.Provider, m.message.Model)
299− modelFormatted := t.S().Muted.Render(model.Name)
299+ modelFormatted := t.S().Muted.Render(model.Model)
300 assistant := fmt.Sprintf("%s %s %s", icon, modelFormatted, infoMsg)
300 assistant := fmt.Sprintf("%s %s %s", icon, modelFormatted, infoMsg)
301 return t.S().Base.PaddingLeft(2).Render(
301 return t.S().Base.PaddingLeft(2).Render(
302 core.Section(assistant, m.width-2),
302 core.Section(assistant, m.width-2),
internal/tui/components/chat/sidebar/sidebar.go+1−1
@@ -481,7 +481,7 @@ func (s *sidebarCmp) currentModelBlock() string {
481 t := styles.CurrentTheme()
481 t := styles.CurrentTheme()
482
482
483 modelIcon := t.S().Base.Foreground(t.FgSubtle).Render(styles.ModelIcon)
483 modelIcon := t.S().Base.Foreground(t.FgSubtle).Render(styles.ModelIcon)
484− modelName := t.S().Text.Render(model.Name)
484+ modelName := t.S().Text.Render(model.Model)
485 modelInfo := fmt.Sprintf("%s %s", modelIcon, modelName)
485 modelInfo := fmt.Sprintf("%s %s", modelIcon, modelName)
486 parts := []string{
486 parts := []string{
487 modelInfo,
487 modelInfo,
internal/tui/components/dialogs/models/models.go+3−3
@@ -264,7 +264,7 @@ func (m *modelDialogCmp) SetModelType(modelType int) tea.Cmd {
264 for i, model := range providerConfig.Models {
264 for i, model := range providerConfig.Models {
265 configProvider.Models[i] = provider.Model{
265 configProvider.Models[i] = provider.Model{
266 ID: model.ID,
266 ID: model.ID,
267− Name: model.Name,
267+ Model: model.Model,
268 CostPer1MIn: model.CostPer1MIn,
268 CostPer1MIn: model.CostPer1MIn,
269 CostPer1MOut: model.CostPer1MOut,
269 CostPer1MOut: model.CostPer1MOut,
270 CostPer1MInCached: model.CostPer1MInCached,
270 CostPer1MInCached: model.CostPer1MInCached,
@@ -285,7 +285,7 @@ func (m *modelDialogCmp) SetModelType(modelType int) tea.Cmd {
285 }
285 }
286 modelItems = append(modelItems, commands.NewItemSection(name))
286 modelItems = append(modelItems, commands.NewItemSection(name))
287 for _, model := range configProvider.Models {
287 for _, model := range configProvider.Models {
288− modelItems = append(modelItems, completions.NewCompletionItem(model.Name, ModelOption{
288+ modelItems = append(modelItems, completions.NewCompletionItem(model.Model, ModelOption{
289 Provider: configProvider,
289 Provider: configProvider,
290 Model: model,
290 Model: model,
291 }))
291 }))
@@ -315,7 +315,7 @@ func (m *modelDialogCmp) SetModelType(modelType int) tea.Cmd {
315 }
315 }
316 modelItems = append(modelItems, commands.NewItemSection(name))
316 modelItems = append(modelItems, commands.NewItemSection(name))
317 for _, model := range provider.Models {
317 for _, model := range provider.Models {
318− modelItems = append(modelItems, completions.NewCompletionItem(model.Name, ModelOption{
318+ modelItems = append(modelItems, completions.NewCompletionItem(model.Model, ModelOption{
319 Provider: provider,
319 Provider: provider,
320 Model: model,
320 Model: model,
321 }))
321 }))
internal/tui/page/chat/chat.go+1−1
@@ -175,7 +175,7 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
175 if model.SupportsImages {
175 if model.SupportsImages {
176 return p, util.CmdHandler(OpenFilePickerMsg{})
176 return p, util.CmdHandler(OpenFilePickerMsg{})
177 } else {
177 } else {
178− return p, util.ReportWarn("File attachments are not supported by the current model: " + model.Name)
178+ return p, util.ReportWarn("File attachments are not supported by the current model: " + model.Model)
179 }
179 }
180 case key.Matches(msg, p.keyMap.Tab):
180 case key.Matches(msg, p.keyMap.Tab):
181 if p.session.ID == "" {
181 if p.session.ID == "" {