langchaingo
langchaingo copied to clipboard
ToChatMessage() doesn't support SystemChatMessage
Hello, is there a reason why ToChatMessage doesn't support SystemChatMessage? What's the solution for that? Thanks.
func (c ChatMessageModel) ToChatMessage() ChatMessage {
switch c.Type {
case string(ChatMessageTypeAI):
return AIChatMessage{Content: c.Data.Content}
case string(ChatMessageTypeHuman):
return HumanChatMessage{Content: c.Data.Content}
default:
slog.Warn("convert to chat message failed with invalid message type", "type", c.Type)
return nil
}
}