googleapis / googleapis/nodejs-agentplatform

Gemini 2.5 Flash - empty responses

Open
#516 0 comments 0 reactions 0 assignees View on GitHub
api: aiplatform priority: p3 type: question
Dominant language
TypeScript
Stars
182
Forks
69
Avg merge
1d 8h
Merged PRs (30d)
10

Description

edit: is it actually because of there's no way to disable reasoning now, so it's consuming tokens and stops before final output is generated? However, I don't see the 'thinking' part in the response.

Hi,

Identical request works for Gemini 2.0 Flash / Flash-Lite, but doesn't work for 2.5 Flash.

Sample request for 2.5 Flash below.

Model options:
```
{
"model": "gemini-2.5-flash-preview-04-17",
"generationConfig": {
"maxOutputTokens": 150,
"temperature": 0.5,
"topP": 0.9,
"frequencyPenalty": 0
},
"systemInstruction": {
"role": "system",
"parts": [
{
"text": "Answer in Polish"
}
]
}
}
```

Contents:
```
[
{
"role": "user",
"parts": [
{
"text": "Hello, how are you?"
}
]
}
]
```

Response:
```
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": ""
}
]
},
"finishReason": "STOP",
"index": 0
}
],
"usageMetadata": {
"promptTokenCount": 9,
"totalTokenCount": 9,
"trafficType": "ON_DEMAND",
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 9
}
]
},
"modelVersion": "gemini-2.5-flash-preview-04-17",
"createTime": "2025-04-23T13:40:26.355612Z",
"responseId": "yu0IaJzaFevA-O4P6JfmsQM"
}
```

Whereas a response for 2.0 Flash-Lite is:
```
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "Cześć! Mam się dobrze, a Ty? (Hi! I'm doing well, and you?)\n"
}
]
},
"finishReason": "STOP",
"avgLogprobs": -0.13025762818076395,
"index": 0
}
],
"usageMetadata": {
"promptTokenCount": 9,
"candidatesTokenCount": 22,
"totalTokenCount": 31,
"trafficType": "ON_DEMAND",
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 9
}
],
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 22
}
]
},
"modelVersion": "gemini-2.0-flash-lite-001",
"createTime": "2025-04-23T13:44:22.320826Z",
"responseId": "tu4IaLrKE-_zmecPzdbj4AQ"
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.