Implement OpenRouter Model Support in AI Prompt System
Deploy Development / deploy (push) Successful in 41s
Test Suite / pytest-backend (push) Successful in 39s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m14s
Deploy Development / deploy (push) Successful in 41s
Test Suite / pytest-backend (push) Successful in 39s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m14s
- Added `openrouter_model` field to the `ai_prompts` table, allowing for optional model overrides per prompt. - Updated the `exercise_ai` module to utilize the effective OpenRouter model based on prompt-specific settings, enhancing flexibility in AI interactions. - Enhanced the admin interface to support OpenRouter model configuration for prompts, improving usability for Superadmins. - Incremented application version to 0.8.161 and updated changelog to reflect these changes, including migration details and new functionality.
This commit is contained in:
1 parent
0551bb3d80
commit
93b8d09d05
11 files changed
+117
-24
No files matched your search
@@ -23,6 +23,7 @@ export default function AdminAiPromptsPage() {
|
||||
const [draftName, setDraftName] = useState('')
|
||||
const [draftDesc, setDraftDesc] = useState('')
|
||||
const [draftTemplate, setDraftTemplate] = useState('')
|
||||
const [draftOpenrouterModel, setDraftOpenrouterModel] = useState('')
|
||||
const [draftActive, setDraftActive] = useState(true)
|
||||
|
||||
const [pvTitle, setPvTitle] = useState('Testübung')
|
||||
@@ -74,6 +75,9 @@ export default function AdminAiPromptsPage() {
|
||||
setDraftName(d.display_name || '')
|
||||
setDraftDesc(d.description || '')
|
||||
setDraftTemplate(d.template || '')
|
||||
setDraftOpenrouterModel(
|
||||
typeof d.openrouter_model === 'string' ? d.openrouter_model : ''
|
||||
)
|
||||
setDraftActive(!!d.active)
|
||||
setPvPreview(null)
|
||||
}
|
||||
@@ -96,6 +100,7 @@ export default function AdminAiPromptsPage() {
|
||||
display_name: draftName,
|
||||
description: draftDesc,
|
||||
active: draftActive,
|
||||
openrouter_model: draftOpenrouterModel.trim(),
|
||||
})
|
||||
await loadList()
|
||||
const nd = await api.getAdminAiPrompt(detail.id)
|
||||
@@ -201,6 +206,11 @@ export default function AdminAiPromptsPage() {
|
||||
inaktiv
|
||||
</span>
|
||||
) : null}
|
||||
{p.openrouter_model ? (
|
||||
<span style={{ fontSize: 11, color: 'var(--text3)' }} title="OpenRouter-Modell für diesen Prompt">
|
||||
Model: <code>{p.openrouter_model}</code>
|
||||
</span>
|
||||
) : null}
|
||||
{p.is_modified ? <span style={{ fontSize: 11 }}>(von Referenz abweichend)</span> : null}
|
||||
</button>
|
||||
</li>
|
||||
@@ -231,6 +241,17 @@ export default function AdminAiPromptsPage() {
|
||||
onChange={(e) => setDraftDesc(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<div className="form-row">
|
||||
<label className="form-label">OpenRouter-Modell (optional)</label>
|
||||
<input
|
||||
className="form-input"
|
||||
placeholder="Leer = Server-OPENROUTER_MODEL · z.B. anthropic/claude-3.5-haiku"
|
||||
autoComplete="off"
|
||||
spellCheck={false}
|
||||
value={draftOpenrouterModel}
|
||||
onChange={(e) => setDraftOpenrouterModel(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<label style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 12 }}>
|
||||
<input type="checkbox" checked={draftActive} onChange={(e) => setDraftActive(e.target.checked)} />
|
||||
Aktiv
|
||||
|
||||
Reference in new issue
Block a user