Skip to content
代码片段 群组 项目
未验证 提交 1d4eea09 编辑于 作者: Patrick Cyiza's avatar Patrick Cyiza 提交者: GitLab
浏览文件

Merge branch...

Merge branch '476258-add-blocking-modal-when-user-attempts-to-delete-self-hosted-model-in-use' into 'master' 

Maps featureSettings in SelfHostedModelType

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/166480



Merged-by: default avatarPatrick Cyiza <jpcyiza@gitlab.com>
Approved-by: default avatarPatrick Cyiza <jpcyiza@gitlab.com>
Co-authored-by: default avatarEduardo Bonet <ebonet@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -17751,6 +17751,7 @@ Self-hosted LLM servers.
| ---- | ---- | ----------- |
| <a id="aiselfhostedmodelcreatedat"></a>`createdAt` | [`Time!`](#time) | Timestamp of creation. |
| <a id="aiselfhostedmodelendpoint"></a>`endpoint` | [`String!`](#string) | Endpoint of the self-hosted model server. |
| <a id="aiselfhostedmodelfeaturesettings"></a>`featureSettings` | [`AiFeatureSettingConnection`](#aifeaturesettingconnection) | AI feature settings using the self-hosted model. (see [Connections](#connections)) |
| <a id="aiselfhostedmodelhasapitoken"></a>`hasApiToken` | [`Boolean!`](#boolean) | Indicates if an API key is set for the self-hosted model server. |
| <a id="aiselfhostedmodelid"></a>`id` | [`AiSelfHostedModelID!`](#aiselfhostedmodelid) | ID of the self-hosted model server. |
| <a id="aiselfhostedmodelidentifier"></a>`identifier` | [`String`](#string) | Identifier for 3rd party model provider. |
......@@ -22,6 +22,11 @@ class SelfHostedModelType < ::Types::BaseObject
field :name, String, null: false, description: 'Deployment name of the self-hosted model.'
field :updated_at, Types::TimeType, null: true, description: 'Timestamp of last update.'
field :feature_settings,
Types::Ai::FeatureSettings::FeatureSettingType.connection_type,
null: true,
description: 'AI feature settings using the self-hosted model.'
def has_api_token # rubocop:disable Naming/PredicateName -- otherwise resolver matcher don't work
object.api_token.present?
end
......
......@@ -9,7 +9,7 @@ class SelfHostedModel < ApplicationRecord
validates :name, presence: true, uniqueness: true
validates :identifier, length: { maximum: 255 }, allow_nil: true
has_many :feature_settings
has_many :feature_settings, foreign_key: :ai_self_hosted_model_id, inverse_of: :self_hosted_model
attr_encrypted :api_token,
mode: :per_attribute_iv,
......
......@@ -4,7 +4,7 @@
RSpec.describe GitlabSchema.types['AiSelfHostedModel'], feature_category: :"self-hosted_models" do
it 'has specific fields' do
expected_fields = %w[id name created_at updated_at model endpoint has_api_token identifier]
expected_fields = %w[id name created_at updated_at model endpoint has_api_token identifier feature_settings]
expect(described_class).to include_graphql_fields(*expected_fields)
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册