Skip to content

Commit

Permalink
feat: load google secret from b64
Browse files Browse the repository at this point in the history
  • Loading branch information
jackmcguire1 committed Dec 14, 2023
1 parent 7aaca8b commit bdb4b97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
- run: sam build --parameter-overrides Runtime=provided.al2 Handler=bootstrap Architecture=arm64 ApiKey=${{ secrets.OPENAI_API_KEY }}
- run: sam deploy --stack-name chat-gpt --s3-bucket ${{ secrets.S3_BUCKET }} --parameter-overrides Runtime=provided.al2 Handler=bootstrap Architecture=arm64 GptApiKey=${{ secrets.OPENAI_API_KEY }} GeminiApiKey='${{ secrets.GEMINI_API_KEY }}' --capabilities CAPABILITY_IAM
- run: sam deploy --stack-name chat-gpt --s3-bucket ${{ secrets.S3_BUCKET }} --parameter-overrides Runtime=provided.al2 Handler=bootstrap Architecture=arm64 GptApiKey=${{ secrets.OPENAI_API_KEY }} GeminiApiKey=${{ secrets.GEMINI_API_KEY }} --capabilities CAPABILITY_IAM
5 changes: 4 additions & 1 deletion internal/dom/chatmodels/gemini_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package chatmodels

import (
"context"
"encoding/base64"

"github.com/google/generative-ai-go/genai"
"github.com/sashabaranov/go-openai"
Expand All @@ -14,8 +15,10 @@ type GeminiApiClient struct {
}

func NewGeminiApiClient(token string) *GeminiApiClient {
tkn, _ := base64.StdEncoding.DecodeString(token)

return &GeminiApiClient{
Token: []byte(token),
Token: tkn,
}
}

Expand Down

0 comments on commit bdb4b97

Please sign in to comment.