Update CompletionWorker interface
What does this MR do and why?
It update worker signature to use AiMessage serialization instead of passing exploded params list. No user facing changes, pure refactoring.
How to set up and validate locally
- Use any AI feature. E.g. "chat" or "explain vulnerability"
- Use forward compatible code in Rails console.
message = Gitlab::Llm::ChatMessage.new(user: User.first, resource: User.first, role: 'user', content: 'list me 5 ruby frameworks', request_id: SecureRandom.uuid, ai_action: 'chat')
message.save!
::Llm::CompletionWorker.perform_async(::Llm::CompletionWorker.serialize_message(message), {})
- Reload webUI page and open chat. You should see the answer to your question "list me 5 ruby frameworks".
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