summaryrefslogtreecommitdiff
path: root/doConnect.go.notyet
diff options
context:
space:
mode:
Diffstat (limited to 'doConnect.go.notyet')
-rw-r--r--doConnect.go.notyet28
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
-}