Skip to content

Commit 76fe4dd

Browse files
authored
docs: add scope when loading credentials from file in google (#1850)
1 parent 09606c0 commit 76fe4dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/models/google.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ from pydantic_ai import Agent
8080
from pydantic_ai.models.google import GoogleModel
8181
from pydantic_ai.providers.google import GoogleProvider
8282

83-
credentials = service_account.Credentials.from_service_account_file('path/to/service-account.json')
83+
credentials = service_account.Credentials.from_service_account_file(
84+
'path/to/service-account.json',
85+
scopes=['https://www.googleapis.com/auth/cloud-platform'],
86+
)
8487
provider = GoogleProvider(credentials=credentials)
8588
model = GoogleModel('gemini-1.5-flash', provider=provider)
8689
agent = Agent(model)

0 commit comments

Comments
 (0)