google / google/adk-python

Drop the `.env`, it's cleaner (ADK should pick up project and location from GCP metadata server)

Aperta
#2,685 6 commenti 2 reazioni 1 assegnatario Rivendicata da @Jacksunwei Vedi su GitHub
agent engine needs review
Lingua principale
Python
Stelle
21.5k
Fork
4k
Merge medio
1g 14h
PR unite (30g)
37

Descrizione

## Problem

When deploying ADK to Google Cloud, I must pass a `.env` file with these:

```
GOOGLE_GENAI_USE_VERTEXAI=TRUE
GOOGLE_CLOUD_PROJECT=my-project
GOOGLE_CLOUD_LOCATION=us-central1
```

## Proposal

This should not be needed when deploying to GCP:

- `GOOGLE_GENAI_USE_VERTEXAI` should be assumed to be `TRUE` unless an API key is provided.
- `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` should be retrieved from the instance metadata server.

A note on instance metadata server:

Every GCP runtime exposes the same instance metadata server which allows retrieving project and location. See [reference for Cloud Run](https://cloud.google.com/run/docs/container-contract#metadata-server). It's trivial for ADK to query it (see [example Go code](https://github.com/GoogleCloudPlatform/cloud-run-hello/blob/master/hello.go#L119-L133))

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.