Encapsulate more model logic in ChatMessage
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
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Pavel Shutsin