Draft: Proposal 2
The Config
# config/unit_primitives/code_suggestions.yml
---
name: code_suggestions
description:
cut_off_date: 2024-02-15T00:00:00+00:00
min_gitlab_version_for_free_access:
min_gitlab_version: '16.8'
unit_primitive_issue_url:
introduced_by_url:
documentation_url:
group: group::code suggestions
feature_category: code_suggestions
# config/backend_services/ai_gateway.yml
---
name: ai_gateway
description:
project_url: https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist
group: group::ai framework
jwt_aud: gitlab-ai-gateway
unit_primitives:
- code_suggestions
- documentation_search
- duo_chat
- explain_vulnerability
- generate_commit_message
- glab_ask_git_command
- resolve_vulnerability
- summarize_comments
- troubleshoot_job
# config/add_ons/duo_pro.yml
---
name: duo_pro
description:
unit_primitives:
- code_suggestions
- documentation_search
- duo_chat
# config/license_types/ultimate.yml
---
name: ultimate
description:
unit_primitives:
- code_suggestions
- documentation_search
- duo_chat
- explain_vulnerability
- generate_commit_message
- glab_ask_git_command
- resolve_vulnerability
- summarize_comments
- troubleshoot_job
...
The API:
> Gitlab::CloudConnector::AccessData::BackendServices.find_by_name(:ai_gateway).unit_primitives.find_by_name(:duo_chat).add_ons.map(&:name)
> [:duo_pro, :duo_enterprise]
> Gitlab::CloudConnector::AccessData::UnitPrimitives.find_by_name(:duo_chat).backend_services.map(&:name)
> [:ai_gateway]
> Gitlab::CloudConnector::AccessData::AddOn.find_by_name(:duo_pro).unit_primitives.map(&:name)
> [:code_suggestions, :duo_chat, :documentation_search]
> Gitlab::CloudConnector::AccessData::LicenseType.find_by_name(:premium).unit_primitives.map(&:name)
> [:code_suggestions, :duo_chat, :documentation_search]
> Gitlab::CloudConnector::AccessData::GitlabRealm.find_by_name(:self_managed).unit_primitives.map(&:name)
> [:code_suggestions, :documentation_search, :duo_chat, :explain_vulnerability, :generate_commit_message, :glab_ask_git_command, :resolve_vulnerability, :summarize_comments, :troubleshoot_job]
I extracted the common code from both Proposal 1 and Proposal 2 at Draft: Add configs relations and api (!9 - closed), so it's easier to review/compare
Edited by Nikola Milojevic