Skip to content

Commit 1c01bc0

Browse files
feat: ollama-integration
2 parents d1682fe + 3d6e7d9 commit 1c01bc0

19 files changed

Lines changed: 944 additions & 38 deletions

File tree

internal/config/engines.go

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
package config
22

3-
import "github.com/harshalranjhani/genie/internal/structs"
3+
import (
4+
"strings"
5+
6+
"github.com/harshalranjhani/genie/internal/structs"
7+
)
48

59
const (
610
GeminiEngine = "Gemini"
711
GPTEngine = "GPT"
812
DeepSeekEngine = "DeepSeek"
13+
OllamaEngine = "Ollama"
914
)
1015

1116
// EngineMap stores all available engines
@@ -62,12 +67,31 @@ var EngineMap = map[string]structs.Engine{
6267
SupportsDocumentation: true,
6368
},
6469
},
70+
"Ollama": {
71+
Name: "Ollama",
72+
Models: []string{
73+
"llama3.2",
74+
},
75+
DefaultModel: "llama3.2",
76+
Features: structs.EngineFeatures{
77+
SupportsImageGen: false,
78+
SupportsChat: true,
79+
SupportsSafeMode: false,
80+
SupportsReasoning: false,
81+
SupportsDocumentation: true,
82+
},
83+
},
6584
}
6685

67-
// Helper functions
68-
func GetEngine(name string) (structs.Engine, bool) {
69-
engine, exists := EngineMap[name]
70-
return engine, exists
86+
func CheckAndGetEngine(name string) (structs.Engine, bool) {
87+
lookupName := strings.ToLower(name)
88+
89+
for engineName, engine := range EngineMap {
90+
if strings.ToLower(engineName) == lookupName {
91+
return engine, true
92+
}
93+
}
94+
return structs.Engine{}, false
7195
}
7296

7397
func GetNextEngine(currentEngine string) string {
@@ -77,6 +101,8 @@ func GetNextEngine(currentEngine string) string {
77101
case "GPT":
78102
return "DeepSeek"
79103
case "DeepSeek":
104+
return "Ollama"
105+
case "Ollama":
80106
return "Gemini"
81107
default:
82108
return "Gemini"

0 commit comments

Comments
 (0)