henk/main.go

44 lines
1.2 KiB
Go
Raw Normal View History

2025-02-21 10:53:24 +01:00
package main
import (
"fmt"
2025-02-21 15:22:17 +01:00
2025-02-25 09:22:10 +01:00
"go-mod.ewintr.nl/henk/structure"
)
2025-02-21 15:22:17 +01:00
func main() {
2025-02-25 09:22:10 +01:00
filePath := "." // Replace with your Go file path
2025-02-21 15:22:17 +01:00
2025-02-25 09:22:10 +01:00
tree, err := structure.BuildTree(filePath)
2025-02-21 15:22:17 +01:00
if err != nil {
fmt.Println(err)
}
2025-02-25 09:22:10 +01:00
structure.PrintTree(tree, "")
// err := structure.ProcessGoFile(filePath)
// if err != nil {
// fmt.Println(err)
// }
2025-02-21 15:22:17 +01:00
}
// startDir := "."
// err := filepath.Walk(startDir, walkFunc)
// if err != nil {
// log.Fatalf("Error walking the path: %v\n", err)
// }
// ollamaClient := llm.NewOllama("http://192.168.1.12:11434", "nomic-embed-text:latest", "qwen2.5-coder:32b-instruct-q8_0")
// response, err := ollamaClient.Complete("You are a nice person.", "Say Hi!")
// if err != nil {
// fmt.Println("Error:", err)
// return
// }
// fmt.Println(response)
// prompt := fmt.Sprintf("The following is a file with Go source code. Split the code up into logical snippets. Snippets are either a function, a type, a constant or a variable. List the identifier and the line range for each snippet. Respond in JSON. \n\n Here comes the source code:\n\n```\n%s\n```", sourceDoc)
// response, err := ollamaClient.CompleteWithSnippets(systemMessage, prompt)
// if err != nil {
// fmt.Println("Error:", err)
// return
// }
// fmt.Printf("%+v\n", response)