Clarify upload mode in RAG playground
This commit is contained in:
parent
b7846d89ed
commit
7cfb713aac
3 changed files with 25 additions and 1 deletions
|
|
@ -26,6 +26,7 @@ const ingestSourceRef = document.getElementById("ingestSourceRef");
|
|||
const ingestUploadFile = document.getElementById("ingestUploadFile");
|
||||
const ingestMode = document.getElementById("ingestMode");
|
||||
const ingestTags = document.getElementById("ingestTags");
|
||||
const ingestModeHint = document.getElementById("ingestModeHint");
|
||||
|
||||
const bootstrapQuery = document.getElementById("bootstrapQuery");
|
||||
const bootstrapMode = document.getElementById("bootstrapMode");
|
||||
|
|
@ -56,6 +57,21 @@ function buildScopeLabel(scope) {
|
|||
return `${scope.sourceRef} [${modes}]`;
|
||||
}
|
||||
|
||||
function updateIngestUiState() {
|
||||
const hasUpload = Boolean(ingestUploadFile.files && ingestUploadFile.files[0]);
|
||||
ingestSourceType.value = hasUpload ? "file" : ingestSourceType.value;
|
||||
ingestSourceType.disabled = hasUpload;
|
||||
ingestSourceRef.disabled = hasUpload;
|
||||
|
||||
if (hasUpload) {
|
||||
ingestModeHint.textContent = `Upload directo activo: se ingerira el archivo local "${ingestUploadFile.files[0].name}" y se ignorara la ruta manual.`;
|
||||
ingestModeHint.classList.add("strong");
|
||||
} else {
|
||||
ingestModeHint.textContent = "Si seleccionas un archivo local, el playground usara upload directo y podras aislarlo con un `sourceId` propio para no mezclarlo con otros scopes.";
|
||||
ingestModeHint.classList.remove("strong");
|
||||
}
|
||||
}
|
||||
|
||||
function request(url, payload, method = "POST") {
|
||||
return fetch(url, {
|
||||
method,
|
||||
|
|
@ -188,6 +204,8 @@ scopePresetSelect.addEventListener("change", () => {
|
|||
}
|
||||
});
|
||||
|
||||
ingestUploadFile.addEventListener("change", updateIngestUiState);
|
||||
|
||||
healthButton.addEventListener("click", async () => {
|
||||
healthResult.textContent = "Comprobando...";
|
||||
try {
|
||||
|
|
@ -232,6 +250,7 @@ ingestButton.addEventListener("click", async () => {
|
|||
|
||||
ingestResult.textContent = format(data);
|
||||
await loadScopes();
|
||||
updateIngestUiState();
|
||||
} catch (error) {
|
||||
ingestResult.textContent = String(error);
|
||||
}
|
||||
|
|
@ -349,3 +368,4 @@ loadScopes();
|
|||
loadAnswerModels();
|
||||
renderBootstrapContext();
|
||||
renderChatHistory();
|
||||
updateIngestUiState();
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
<input id="ingestTags" value="workspace,global-docs" />
|
||||
</label>
|
||||
</div>
|
||||
<p class="helper">Si seleccionas un archivo local, el playground usara upload directo y podras aislarlo con un `sourceId` propio para no mezclarlo con otros scopes.</p>
|
||||
<p class="helper" id="ingestModeHint">Si seleccionas un archivo local, el playground usara upload directo y podras aislarlo con un `sourceId` propio para no mezclarlo con otros scopes.</p>
|
||||
<div class="actions">
|
||||
<button id="ingestButton">Lanzar ingesta</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -85,6 +85,10 @@ h1, h2, h3 { margin: 0 0 12px; }
|
|||
margin: 0 0 16px;
|
||||
}
|
||||
|
||||
.helper.strong {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
gap: 24px;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue