diff options
| author | Jeff Carr <[email protected]> | 2025-08-30 14:42:57 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-08-30 14:42:57 -0500 |
| commit | 7f8f5e3b9b37fccbb357b70e6490823a8b22ae7e (patch) | |
| tree | 11b6f74e8d3f33b3fdb82421cb79653f65685fe8 /doConnect.go.notyet | |
| parent | c971bfddf74d48d87f10f5f050b1eef3fd12bf20 (diff) | |
basic JSON parsing into genai struc
Diffstat (limited to 'doConnect.go.notyet')
| -rw-r--r-- | doConnect.go.notyet | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/doConnect.go.notyet b/doConnect.go.notyet deleted file mode 100644 index 52fdc7c..0000000 --- a/doConnect.go.notyet +++ /dev/null @@ -1,28 +0,0 @@ -package main - -import ( - "context" - "fmt" - "os" - - "github.com/google/generative-ai-go/genai" - "google.golang.org/api/option" -) - -// doConnect initializes and returns a Gemini client. -// It reads the API key from the GEMINI_API_KEY environment variable. -func doConnect() (*genai.GenerativeModel, error) { - apiKey := os.Getenv("GEMINI_API_KEY") - if apiKey == "" { - return nil, fmt.Errorf("GEMINI_API_KEY environment variable not set") - } - - ctx := context.Background() - client, err := genai.NewClient(ctx, option.WithAPIKey(apiKey)) - if err != nil { - return nil, fmt.Errorf("failed to create new genai client: %w", err) - } - - model := client.GenerativeModel("gemini-pro") - return model, nil -} |
