a2aproject / a2aproject/a2a-samples

[Bug]: crewai sample doesn't work, doesn't generate images

Aberta
#43 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Jupyter Notebook
Estrelas
1.8k
Forks
751
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

### What happened?

```bash
> cd A2A/samples/python/agents/crewai
> cat .env
GOOGLE_API_KEY="xxxxxxxxx"
> uv run .
```

Starts up ok, but doesn't generate images.

**API keys are not supported by this API. Expected OAuth2 access token or other authentication credentials that assert a principal. See https://cloud.google.com/docs/authentication**

```
INFO:httpx:HTTP Request: POST https://aiplatform.googleapis.com/v1beta1/publishers/google/models/gemini-2.0-flash-exp-image-generation:generateContent "HTTP/1.1 401 Unauthorized"
ERROR:agent:Error generating image 401 UNAUTHENTICATED. {'error': {'code': 401, 'message': 'API keys are not supported by this API. Expected OAuth2 access token or other authentication credentials that assert a principal. See https://cloud.google.com/docs/authentication', 'status': 'UNAUTHENTICATED', 'details': [{'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'CREDENTIALS_MISSING', 'domain': 'googleapis.com', 'metadata': {'service': 'aiplatform.googleapis.com', 'method': 'google.cloud.aiplatform.v1beta1.PredictionService.GenerateContent'}}]}}
Exception 401 UNAUTHENTICATED. {'error': {'code': 401, 'message': 'API keys are not supported by this API. Expected OAuth2 access token or other authentication credentials that assert a principal. See https://cloud.google.com/docs/authentication', 'status': 'UNAUTHENTICATED', 'details': [{'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'CREDENTIALS_MISSING', 'domain': 'googleapis.com', 'metadata': {'service': 'aiplatform.googleapis.com', 'method': 'google.cloud.aiplatform.v1beta1.PredictionService.GenerateContent'}}]}}
```

### Relevant log output

```shell

```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

The issue is in the crewai sample at samples/python/agents/crewai. The error indicates the Google AI Platform image generation API requires OAuth2 authentication, not an API key. Check the sample's code for how it configures the Gemini model client, likely in a main script or configuration file. Compare with Google's authentication documentation to switch from an API key to an OAuth2 token or service account credentials. Verify the fix by running the sample again and ensuring images are generated.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
google-cloud, python
Domínio
ai, backend
Tipo de issue
Bug
Dificuldade
2/5
Tempo estimado
1-3 horas
Status de atividade
Estagnada
Clareza
Claramente especificada
Facilidade para iniciantes
55/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.