agent-zero/plugins/_model_config/webui/config.html
Alessandro 539d809789 feat: add agent profile switcher to chat composer
Surface the active Agent Profile beside the model preset switcher and let users switch profiles through the existing settings flow.

- add agent profile metadata to state snapshots
- list available profiles in the chat composer profile dropdown
- persist profile changes via settings_get/settings_set
- add a Create new Agent Profile action that opens a guided a0-create-agent chat
- rename the agent-profile creation skill/docs from a0-new-agent to a0-create-agent
- clean up fetchApi imports for related WebUI modules
2026-04-22 14:25:18 +02:00

84 lines
2.9 KiB
HTML

<html>
<head>
<title>Model Configuration</title>
<script type="module">
import { store } from "/plugins/_model_config/webui/model-config-store.js";
</script>
</head>
<body>
<div x-data
x-init="
await $store.modelConfig.ensureLoaded();
$store.modelConfig.resetApiKeyDrafts();
await $store.modelConfig.refreshApiKeyStatus();
$store.modelConfig.initConfigFields(config);
$store.modelConfig.installSettingsHooks(context, config);
">
<template x-if="config && $store.modelConfig._loaded">
<div class="model-config-sections">
<!-- Model Sections (Main, Utility, Embedding) -->
<template x-for="section in $store.modelConfig.MODEL_SECTIONS" :key="section.key">
<div class="model-section"
x-data="{ model: config[section.key], modelType: section.key.replace('_model', ''), providers: $store.modelConfig.getProviders(section.key), searchType: $store.modelConfig.getSearchType(section.key), apiKeyMode: 'store' }">
<div class="section-title" x-text="section.title"></div>
<div class="section-description" x-text="section.desc"></div>
<x-component path="/plugins/_model_config/webui/model-field.html"></x-component>
</div>
</template>
<!-- Per-Chat Override -->
<div class="model-section">
<div class="section-title">Per-Chat Override</div>
<div class="section-description">Allow switching model presets from the chat navigation bar. New chats inherit the active preset.</div>
<div class="field">
<div class="field-label">
<div class="field-title">Enable model switcher</div>
<div class="field-description">Show a preset switcher in the chat navigation bar. Overrides main and utility model for the current chat.</div>
</div>
<div class="field-control">
<label class="toggle">
<input type="checkbox" x-model="config.allow_chat_override" />
<span class="toggler"></span>
</label>
</div>
</div>
<div class="override-presets-link" x-show="config.allow_chat_override">
<button class="text-button" @click="openModal('/plugins/_model_config/webui/main.html')">
<span class="material-symbols-outlined">tune</span>
<span>Edit Presets</span>
</button>
</div>
</div>
</div>
</template>
</div>
<style>
.model-config-sections {
display: flex;
flex-direction: column;
gap: 16px;
}
.model-section {
border: 1px solid var(--color-border);
border-radius: 8px;
padding: 16px;
}
.model-section .section-title {
margin-top: 0;
}
.override-presets-link {
margin-top: 4px;
}
.override-presets-link .text-button {
font-size: 0.78rem !important;
gap: 4px;
}
</style>
</body>
</html>