()
| 20966 | } |
| 20967 | } |
| 20968 | |
| 20969 | // Connect to a self-hosted endpoint and list the models it offers (#462). |
| 20970 | // Proxied via the backend so we hit the server from the Pi's vantage. |
| 20971 | async function connectAIEndpoint() { |
| 20972 | const btn = document.getElementById('ai-connect-btn'); |
| 20973 | const statusDiv = document.getElementById('ai-config-status'); |
| 20974 | const statusMessage = document.getElementById('ai-config-status-message'); |
| 20975 | const modelsRow = document.getElementById('ai-models-row'); |
| 20976 | const select = document.getElementById('ai-model-select'); |
| 20977 | const baseUrl = (document.getElementById('ai-base-url')?.value || '').trim(); |
| 20978 | // The token field shows a masked placeholder when already saved; only send |
| 20979 | // a value the operator actually typed, otherwise let the backend use the |
| 20980 | // stored token. |
| 20981 | const apiKey = (document.getElementById('openai-api-token')?.value || '').trim(); |
nothing calls this directly
no test coverage detected