firebase / firebase/firebase-js-sdk

[VertexAI] `GenerateContentCandidate.parts` is undefined

Open
#9,014 0 comments 0 reactions 1 assignee Claimed by @dlarocque View on GitHub
api: firebaseai bug
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### Operating System

n/a

### Environment (if applicable)

n/a

### Firebase SDK Version

11.7.1

### Firebase SDK Product(s)

VertexAI

### Project Tooling

JS

### Detailed Problem Description

When using multimodal content generation with Gemini and streaming responses, the last chunk returned will have no parts, which causes an internal error.

There is currently no workaround for this issue.

### Steps and code to reproduce issue

```js
const model = getGenerativeModel(ai, { model: 'gemini-2.0-flash-exp', generationConfig: { responseModalities: ['TEXT', 'IMAGE'] }});
model.generateContentStream('generate an image of a dog'); // @firebase/vertexai: FirebaseError: AI: Part should have at least one property, but there are none. This is likely caused by a malformed response from the backend. (AI/invalid-content)
```

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.