Skip to content

Accomodate calls to AIGW's agents endpoint

Alejandro Rodríguez requested to merge ai-gateway-agents into master

What does this MR do and why?

Introduces the base code to be used for feature teams to migrate their prompt and model parameters to the AI Gateway. See !152429 (merged) for an example of a feature migration using this code.

Part of #465858 (closed)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

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

Numbered steps to set up and validate the change are strongly suggested.

  • Follow the steps to setup AI Features on local development https://docs.gitlab.com/ee/development/ai_features/index.html
  • Checkout branch aigw-generate-description, which is based off of this branch and adds an example aigw_service_class
  • Checkout branch generate-description-agent on the AI Gateway and start the service (poetry run ai_gateway)
  • Enable the FF: Feature.enable(:ai_gateway_agents)
  • Run the following on a rails console:
Gitlab::Llm::CompletionsFactory.completion!(Gitlab::Llm::AiMessage.new(role: 'user', user: User.find_by_username('root'), ai_action: :generate_description, content: 'SSH connections are broken', context: Gitlab::Llm::AiMessageContext.new)).execute

... or generate a new issue description via the UI (e.g. at http://127.0.0.1:3000/gitlab-org/gitlab-shell/-/issues/new)

Edited by Alejandro Rodríguez

Merge request reports

Loading