Skip to content

Update CompletionWorker interface

Pavel Shutsin requested to merge update-completion-worker-signature into master

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

  1. Use any AI feature. E.g. "chat" or "explain vulnerability"
  2. 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), {})
  1. 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.

Edited by Pavel Shutsin

Merge request reports

Loading