Skip to content

Implement Abstraction Layer Code Competition model

What does this MR do and why?

As we are working on implementing Code Suggestion using Abstraction layer, we need to bring code_completion model in our code base. This MR is utilizing code-gecko model by adding the code_completion method to the VertexAI::Client.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Run the rails console rails c
  2. Initialize the Vertex client client = Gitlab::Llm::VertexAi::Client.new(my_user)
  3. Call the code_completion method with the valid content, e.g.
client.code_completion(content: { prefix: "def is_palindrome(string)", suffix: ""})

MR acceptance checklist

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

Related to #415581

Edited by Bojan Marjanovic

Merge request reports

Loading