Skip to content

Commit

Permalink
test: update test case for VERTEX_CREDENTIALS
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjiancn committed Jun 15, 2024
1 parent 57693f7 commit 65fd3ee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions llms/googleai/shared_test/shared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,18 @@ func newVertexClient(t *testing.T, opts ...googleai.Option) *vertex.Vertex {
if location == "" {
location = "us-central1"
}
credentials := os.Getenv("VERTEX_CREDENTIALS")

opts = append(opts,
googleai.WithCloudProject(project),
googleai.WithCloudLocation(location),
googleai.WithCredentialsFile(credentials),
)

// If credentials are set, use them.
credentials := os.Getenv("VERTEX_CREDENTIALS")
if credentials != "" {
opts = append(opts, googleai.WithCredentialsFile(credentials))
}

llm, err := vertex.New(context.Background(), opts...)
require.NoError(t, err)
return llm
Expand Down

0 comments on commit 65fd3ee

Please sign in to comment.