glide icon indicating copy to clipboard operation
glide copied to clipboard

💥 Map message roles to unified roles

Open roma-glushko opened this issue 1 year ago • 3 comments

The message roles in the request schema is currently defined as a basic string. However, roles are not exactly the same across all providers. Let's try to unify that aspect of the Glide response contact.

Also, please make the role field optional and will with the user role by default.

roma-glushko avatar Jun 02 '24 19:06 roma-glushko

we are referring to

type ChatRequest struct {
	Message        ChatMessage          `json:"message" validate:"required"`
	MessageHistory []ChatMessage        `json:"messageHistory"`
	Override       *OverrideChatRequest `json:"override,omitempty"`
}

and

type ChatMessage struct {
	// The role of the author of this message. One of system, user, or assistant.
	Role string `json:"role" validate:"required"`
	// The content of the message.
	Content string `json:"content" validate:"required"`
	// The name of the author of this message. May contain a-z, A-Z, 0-9, and underscores,
	// with a maximum length of 64 characters.
	Name string `json:"name,omitempty"`
}

for request schema right ?

ankitsridhar16 avatar Jun 06 '24 07:06 ankitsridhar16

@ankitsridhar16 yes, correct, but be aware please that @tom-fitz is already on this one 👀

roma-glushko avatar Jun 19 '24 19:06 roma-glushko

@roma-glushko please assign this one to me please!

tom-fitz avatar Jun 19 '24 19:06 tom-fitz