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:
2024-11-11 00:23:00 -05:00
parent a83d5f9822
commit 7a43e3a5c8
5 changed files with 82 additions and 20 deletions

View File

@@ -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(), " ")