GenerativeAIExamples icon indicating copy to clipboard operation
GenerativeAIExamples copied to clipboard

Internal server error for role orders in LLM inference

Open kaxap opened this issue 1 year ago • 0 comments

Hi,

I am getting 500s with description

chat messages must alternate roles between 'user' and 'assistant'.  Message may have a leading 'system' role message

and

"Internal Server Error\",\"status\":500,\"detail\":\"Last message role should be 'user'

I think this order validation is unnecessary. Most of the models (e.g. mixtrals, llama3, gemma etc) are perfectly fine with any order of roles. This claim can be validated on groq's playground: https://console.groq.com/playground

This issue currently breaks some existing patterns, like continuations (without the user explicitly saying "continue") or in some cases running agents with observations etc.

kaxap avatar Apr 30 '24 09:04 kaxap