Fix unmarshalling issues and adjust logging for debugging
Modify `FunctionCall` struct to handle arguments as strings. Add debugging logs to facilitate error tracing and improve JSON unmarshalling in various functions.
This commit is contained in:
		| @@ -6,6 +6,7 @@ import ( | ||||
| 	"answer/pkg/search" | ||||
| 	"context" | ||||
| 	gollm "gitea.stevedudenhoeffer.com/steve/go-llm" | ||||
| 	"github.com/joho/godotenv" | ||||
| 	"github.com/urfave/cli" | ||||
| 	"log/slog" | ||||
| 	"os" | ||||
| @@ -36,6 +37,12 @@ func main() { | ||||
| 		Description: "", | ||||
|  | ||||
| 		Flags: []cli.Flag{ | ||||
| 			&cli.StringFlag{ | ||||
| 				Name:  "env-file", | ||||
| 				Value: ".env", | ||||
| 				Usage: "file to read environment variables from", | ||||
| 			}, | ||||
|  | ||||
| 			&cli.StringFlag{ | ||||
| 				Name:  "model", | ||||
| 				Value: "openai/gpt-4o", | ||||
| @@ -66,6 +73,11 @@ func main() { | ||||
| 			if c.NArg() == 0 { | ||||
| 				return cli.ShowAppHelp(c) | ||||
| 			} | ||||
|  | ||||
| 			if c.String("env-file") != "" { | ||||
| 				_ = godotenv.Load(c.String("env-file")) | ||||
| 			} | ||||
|  | ||||
| 			var question answer.Question | ||||
|  | ||||
| 			question.Question = strings.Join(c.Args(), " ") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user