feat: add Google Gemini LLM provider
Add Gemini provider using the generativelanguage.googleapis.com API with systemInstruction support. Activated via --llm gemini with GEMINI_API_KEY env var. Default model: gemini-2.0-flash.
This commit is contained in:
@@ -65,7 +65,7 @@ func init() {
|
||||
rootCmd.PersistentFlags().StringVar(&dbPath, "db", "", "path to SQLite database")
|
||||
rootCmd.PersistentFlags().BoolVar(&verbose, "verbose", false, "enable verbose output")
|
||||
rootCmd.PersistentFlags().StringVar(&profileName, "profile", "", "profile name to use")
|
||||
rootCmd.PersistentFlags().StringVar(&llmFlag, "llm", "", "LLM provider (anthropic, openai, ollama, none)")
|
||||
rootCmd.PersistentFlags().StringVar(&llmFlag, "llm", "", "LLM provider (anthropic, openai, gemini, ollama, none)")
|
||||
}
|
||||
|
||||
// Execute runs the root command.
|
||||
@@ -105,6 +105,13 @@ func getLLMProvider() llm.Provider {
|
||||
return llm.NewNoop()
|
||||
}
|
||||
return llm.NewOpenAI(key, cfg.LLM.Model, nil)
|
||||
case "gemini":
|
||||
key := os.Getenv("GEMINI_API_KEY")
|
||||
if key == "" {
|
||||
fmt.Fprintln(os.Stderr, "Warning: GEMINI_API_KEY not set, LLM features disabled")
|
||||
return llm.NewNoop()
|
||||
}
|
||||
return llm.NewGemini(key, cfg.LLM.Model, nil)
|
||||
case "ollama":
|
||||
return llm.NewOllama(cfg.LLM.Model, cfg.LLM.Endpoint, nil)
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user