-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmain.go
More file actions
29 lines (27 loc) · 963 Bytes
/
main.go
File metadata and controls
29 lines (27 loc) · 963 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
package main
import (
"fmt"
"os"
"github.com/nalindalal/CodeLookout/server/internal/config"
"github.com/nalindalal/CodeLookout/server/internal/llm"
)
// This CLI demonstrates LLM integration using RESTLLMClient
func main() {
cfg := config.Load()
if cfg.LLMEndpoint == "" {
fmt.Println("LLM_ENDPOINT not set in config. Exiting.")
os.Exit(1)
}
// Optionally support LLM_AUTH_TOKEN for HuggingFace
authToken := os.Getenv("LLM_AUTH_TOKEN")
client := &llm.RESTLLMClient{Endpoint: cfg.LLMEndpoint, AuthToken: authToken}
code := "func add(a int, b int) int { return a + b }"
fmt.Println("Sending code to LLM endpoint:", cfg.LLMEndpoint)
result, err := client.AnalyzeCode(code)
if err != nil {
fmt.Println("LLM error:", err)
os.Exit(1)
}
fmt.Println("LLM review result:")
fmt.Println(result)
}