Skip to content

[firebase_vertexai]: role with null value added to the history on content blocked due to Safety reasons #13104

@Flucadetena

Description

@Flucadetena

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Other

Which platforms are affected?

No response

Description

This issue is caused by generative-ai-dart. When a response from the model is blocked due to Safety reasons, the response is added to the history with a null role. This throws an exception and breaks the ChatSession as multi-turn forces you to alternate between user and model roles.

As a null role was added, the history breaks and no further messages can be sent.

This seems to happen only using the method sendMessage and not the sendMessageStream.

There is an already a closed issue in the package and a pull request awaiting review in case someone need to use it temporarily.

Reproducing the issue

Create a new chat instance and force a message to be blocked for safety reasons. Then try to send a new message as a user or model.

Firebase Core version

3.1.1

Flutter Version

3.19.6

Relevant Log Output

No response

Flutter dependencies

No response

Additional context and comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs AttentionThis issue needs maintainer attention.platform: allIssues / PRs which are for all platforms.plugin: vertexailabel issues for vertexai pluginresolution: no-responseCustomer did not respond after some time.triageIssue is currently being triaged.type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions