Class: Labimotion::LabimotionAiAPI

Inherits:
Grape::API
  • Object
show all
Defined in:
lib/labimotion/apis/labimotion_ai_api.rb

Overview

Per-user LabIMotion AI settings: the model, an optional personal API key and an optional provider endpoint of one's own.

These live on the HOST's user profile rather than in a gem table, because the credential belongs to the person, not to LabIMotion — so the routes stay under /profiles and reach the host's Profile through current_user, the same way the rest of this gem reaches ElementPolicy and Matrice.

The API key is stored encrypted and never returned; a read only reports whether one is set.

Constant Summary collapse

DEFAULT_MODELS =

Fallback model choices when the server config (config/labimotion_ai.yml :models) lists none. A representative subset of the chat-capable KI-Toolbox models (ki-toolbox.scc.kit.edu); the full list lives in the yml.

%w[
  azure.gpt-4.1-mini
  azure.gpt-4.1
  azure.gpt-5
  azure.gpt-5-mini
  google.claude-sonnet-4.6
  google.claude-haiku-4.5
  google.gemini-2.5-pro
  kit.gpt-oss-120b
].freeze