Skip to content

Commit

Permalink
Fix details
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Mar 4, 2024
1 parent fe79634 commit 4ec5492
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions bioimageio_chatbot/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1039,16 +1039,17 @@ <h3 class="text-center">Welcome to BioImage.IO Chatbot</h3>
$(`#spinner-${currentMessageId}`).hide();
// Convert the message to HTML using the marked library
const steps = response.steps;
let message = response.text;
let message = response.text && marked(response.text, { renderer: renderer }) || "";
if(steps && steps.length > 0){
message = message + "\n\n<details> <summary>🔍More Details</summary>\n\n"
let details = "<details> <summary>🔍More Details</summary>\n\n"
for(let step of steps){
message = message + `<div class="step">${step.name}</div>\n\n\`\`\`\n\n${JSON.stringify(step.details, null, 2)}\n\n\`\`\`\n\n`
details = details + `<div class="step">${step.name}</div>\n\n\`\`\`\n\n${JSON.stringify(step.details, null, 2)}\n\n\`\`\`\n\n`
}
message = message + "\n\n</details>"
details = details + "\n\n</details>"
details = marked(details, { renderer: renderer })
message = message + details
}
const htmlMessage = message && marked(message, { renderer: renderer });
$(`#content-${currentMessageId}`).html(htmlMessage);
$(`#content-${currentMessageId}`).html(message);
}
}

Expand Down

0 comments on commit 4ec5492

Please sign in to comment.