Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Using history on ChatSession with VertexAI

Hi,

I am trying to create a chat session and set a history node value in the request to GenerateContent.

Unfortunately whatever combination of values i would use would come back with the error

```

rpc error: code = InvalidArgument desc = Please ensure that multiturn requests alternate between user and model.

```

The history node value i put is:

```

[{"Role":"user","Parts":["something from the user"]}]

```

Any idea, what am i doing wrong?

 

Using Go.

2 1 2,662
1 REPLY 1