Maps featureSettings in SelfHostedModelType

What does this MR do and why?

Maps featureSettings in SelfHostedModelType

The feature settings an AI model is assigned to is now accessible when querying self-hosted models in graphql.

Steps to reproduce

  1. On rails console:
Ai::SelfHostedModel.create()
  1. navigate to http://gdk.test:3000/-/graphql_explorer, and run the following query:

    query getSelfHostedModels {
      aiSelfHostedModels(first: 100) {
        nodes {
          id
          name
          model
          endpoint
          hasApiToken
          featureSettings {
            nodes {
              feature
            }
          }
        }
      }
    }   

    The result should be something in the format:

    {
      "data": {
        "aiSelfHostedModels": {
          "nodes": [
            {
              "id": "gid://gitlab/Ai::SelfHostedModel/20",
              "name": "a_cool_model",
              "model": "mistral",
              "endpoint": "http://localhost:4000",
              "hasApiToken": false,
              "featureSettings": {
                "nodes": [
                  {
                    "feature": "code_generations"
                  }
                ]
              }
            }
          ]
        }
      }
    }

Related to #476258 (closed)

Edited by Eduardo Bonet

Merge request reports

Loading