Skip to content

Encapsulate more model logic in ChatMessage

Pavel Shutsin requested to merge move-chat-message-validation-logic into master

What does this MR do and why?

Refactors ChatMessage logic. Key changes:

  • Role validation moved to the model
  • Errors are not squashed into single string anymore.
  • Introduced Ai message factory.
  • ChatMessage is aware of message owner by method user
  • message.save! method.

How to set up and validate locally

  1. Use any AI feature.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Pavel Shutsin

Merge request reports

Loading