babaohuang / GeminiProChat

Minimal web UI for GeminiPro.
https://geminiprochat.com
MIT License
4.25k stars 12.33k forks source link

convert message list into parameters that conforms to the api rules(Interim Solution) #68

Closed stefan-ysh closed 8 months ago

stefan-ysh commented 8 months ago

convert message list into parameters that conforms to the api rules(Interim Solution)

ensure that the user and the model have a one-to-one conversation and avoid any errors like: "Please ensure that multiturn requests ends with a user role or a function response."

Description

It will break the GeminiPro API rules and cause an error if there are two role attributes with the same value in a row in the message list. See the example below.:

image

Linked Issues

28 (聊天出现“Error Please ensure that multiturn requests ends with a user role or a function response.”)

Additional context

For now, this is only a interim solution. You can ignore this pull request if the GeminiPro team officially fixes this issue, or if there is a better way to resolve this problem in the meantime.

netlify[bot] commented 8 months ago

Deploy Preview for heroic-yeot-d77ce3 failed.

Name Link
Latest commit 78de3f80cbb71f78b1b9ba381a7f7bbf0b755b4e
Latest deploy log https://app.netlify.com/sites/heroic-yeot-d77ce3/deploys/6584f0303b7af00009dec4f0
netlify[bot] commented 8 months ago

Deploy request for clinquant-rugelach-6e6c15 pending review.

Visit the deploys page to approve it

Name Link
Latest commit 78de3f80cbb71f78b1b9ba381a7f7bbf0b755b4e
vercel[bot] commented 8 months ago

@stefan-ysh is attempting to deploy a commit to the My Team Team on Vercel.

A member of the Team first needs to authorize it.

babaohuang commented 8 months ago

It's nice ! thank you very much!