Skip to content

Commit

Permalink
refactor(config): remove image input and entity memory mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nullswan committed Oct 2, 2024
1 parent 5ecd8b3 commit 918ac76
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 21 deletions.
1 change: 0 additions & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func defaultConfig() Config {
return Config{
Input: InputConfig{
Text: EnabledConfig{Enabled: true},
Image: EnabledConfig{Enabled: true},
Voice: EnabledConfig{Enabled: true},
},
Output: OutputConfig{
Expand Down
2 changes: 1 addition & 1 deletion internal/config/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

const (
// configDir is the directory where the configuration file is stored.
configDir = ".ai"
configDir = ".golem"
)

// GetHomeDir returns the user's home directory.
Expand Down
5 changes: 1 addition & 4 deletions internal/config/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ func setInputConfigValue(
switch keys[0] {
case "text":
enabled = &input.Text.Enabled
case "image":
enabled = &input.Image.Enabled
case "voice":
enabled = &input.Voice.Enabled
default:
Expand Down Expand Up @@ -99,8 +97,7 @@ func setMemoryConfigValue(
return fmt.Errorf("invalid key for memory: %v", keys)
}
switch MemoryMode(value) {
case MemoryModeKnowledgeGraph,
MemoryModeEntity,
case
MemoryModeConversation,
MemoryModeNone:
memory.Mode = MemoryMode(value)
Expand Down
10 changes: 0 additions & 10 deletions internal/config/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ func Setup() error {
"Enable text input",
cfg.Input.Text.Enabled,
)
cfg.Input.Image.Enabled = promptForBool(
"Enable image input",
cfg.Input.Image.Enabled,
)
cfg.Input.Voice.Enabled = promptForBool(
"Enable voice input",
cfg.Input.Voice.Enabled,
Expand Down Expand Up @@ -47,8 +43,6 @@ func Setup() error {
}

memoryModes := []MemoryMode{
MemoryModeKnowledgeGraph,
MemoryModeEntity,
MemoryModeConversation,
MemoryModeNone,
}
Expand Down Expand Up @@ -125,10 +119,6 @@ func promptForSelect(label string, items []string, defaultIndex int) int {

func getDefaultMemoryModeIndex(mode MemoryMode) int {
switch mode {
case MemoryModeKnowledgeGraph:
return 0
case MemoryModeEntity:
return 1
case MemoryModeConversation:
return 2
case MemoryModeNone:
Expand Down
7 changes: 2 additions & 5 deletions internal/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ type Config struct {

type InputConfig struct {
Text EnabledConfig `yaml:"text" json:"text"`
Image EnabledConfig `yaml:"image" json:"image"`
Voice EnabledConfig `yaml:"voice" json:"voice"`
}

Expand All @@ -33,10 +32,8 @@ type OutputDetailConfig struct {
type MemoryMode string

const (
MemoryModeKnowledgeGraph MemoryMode = "knowledge_graph"
MemoryModeEntity MemoryMode = "entity"
MemoryModeConversation MemoryMode = "conversation"
MemoryModeNone MemoryMode = "none"
MemoryModeConversation MemoryMode = "conversation"
MemoryModeNone MemoryMode = "none"
)

func (m MemoryMode) String() string {
Expand Down

0 comments on commit 918ac76

Please sign in to comment.