-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
39 lines (34 loc) · 652 Bytes
/
main.go
File metadata and controls
39 lines (34 loc) · 652 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"context"
"log"
"os"
"sql-agent/api/server"
"sql-agent/business/agent"
"sql-agent/database"
)
func main() {
// Initialize database
db, err := database.Connect(
os.Getenv("DATABASE_DSN_STRING"))
if err != nil {
log.Fatal(err)
}
defer db.Close()
// Initialize LLM models
executor, err := agent.New(
context.Background(),
os.Getenv("GEMINI_API_KEY"),
"gemini-2.0-flash",
"Alwaleed98/walphi-sql",
db)
if err != nil {
log.Fatal(err)
}
// Initialize and start server
srv := server.New(executor)
log.Println("Starting HTTP Server")
if err := srv.Start(":8080"); err != nil {
log.Fatal(err)
}
}