custom llm

This commit is contained in:
unintendedfraud
2025-12-25 17:58:19 +01:00
parent 8702b87d66
commit d83c326b26
4 changed files with 129 additions and 46 deletions
+13 -1
View File
@@ -8,6 +8,7 @@ import (
"hal/env"
"hal/handlers"
"hal/llm"
discordbot "github.com/bwmarrin/discordgo"
"github.com/joho/godotenv"
@@ -19,7 +20,7 @@ func main() {
fmt.Println("HAL started")
env := env.GetEnvVariables()
handler := handlers.Init(env.OpenaiHalToken, env.GeminiToken)
handler := handlers.Init(&env)
discordToken := fmt.Sprintf("Bot %s", env.Token)
dgclient, err := discordbot.New(discordToken)
@@ -35,6 +36,17 @@ func main() {
return
}
// ---
llmClient := llm.NewClient(&env)
res, err := llmClient.GenerateContent("Quelle est la capitale de la France?")
if err != nil {
panic(err)
}
fmt.Println("### RES ###")
fmt.Println(res)
// ---
// Wait here until CTRL-C or other term signal is received.
sc := make(chan os.Signal, 1)
signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt)