Add Lab 8 embedded red-team chat widget with three defense levels
This commit is contained in:
@@ -4,6 +4,7 @@ import { Fragment, useEffect, useRef, useState } from "react";
|
||||
import { Lab1ConfidenceChat } from "~/components/labs/Lab1ConfidenceChat";
|
||||
import { Lab1NetronPanel } from "~/components/labs/Lab1NetronPanel";
|
||||
import { Lab3TerminalFrame } from "~/components/labs/Lab3TerminalFrame";
|
||||
import { Lab8Chat } from "~/components/labs/Lab8Chat";
|
||||
import { Objective5Chat } from "~/components/labs/Objective5Chat";
|
||||
import { QuantizationGridExplorer } from "~/components/labs/QuantizationGridExplorer";
|
||||
import { QuantizationExplorer } from "~/components/labs/QuantizationExplorer";
|
||||
@@ -37,6 +38,7 @@ const quantizationExplorerToken = "<div data-quantization-explorer></div>";
|
||||
const quantizationGridExplorerToken =
|
||||
"<div data-quantization-grid-explorer></div>";
|
||||
const objective5ChatToken = "<div data-objective5-chat></div>";
|
||||
const lab8ChatToken = "<div data-lab8-chat></div>";
|
||||
const lab3TerminalToken = "<div data-lab3-terminal></div>";
|
||||
const lab1ConfidenceToken = "<div data-lab1-confidence></div>";
|
||||
const lab1NetronToken = "<div data-lab1-netron-panel></div>";
|
||||
@@ -263,7 +265,7 @@ export function LabContent({ className, html }: LabContentProps) {
|
||||
const renderedContent = html
|
||||
.split(
|
||||
new RegExp(
|
||||
`(${escapeRegex(quantizationExplorerToken)}|${escapeRegex(quantizationGridExplorerToken)}|${escapeRegex(objective5ChatToken)}|${escapeRegex(lab3TerminalToken)}|${escapeRegex(lab1ConfidenceToken)}|${escapeRegex(lab1NetronToken)}|${escapeRegex(tokenizerPlaygroundToken)})`,
|
||||
`(${escapeRegex(quantizationExplorerToken)}|${escapeRegex(quantizationGridExplorerToken)}|${escapeRegex(objective5ChatToken)}|${escapeRegex(lab8ChatToken)}|${escapeRegex(lab3TerminalToken)}|${escapeRegex(lab1ConfidenceToken)}|${escapeRegex(lab1NetronToken)}|${escapeRegex(tokenizerPlaygroundToken)})`,
|
||||
"g",
|
||||
),
|
||||
)
|
||||
@@ -285,6 +287,10 @@ export function LabContent({ className, html }: LabContentProps) {
|
||||
return <Objective5Chat key={`objective5-chat-${index}`} />;
|
||||
}
|
||||
|
||||
if (part === lab8ChatToken) {
|
||||
return <Lab8Chat key={`lab8-chat-${index}`} />;
|
||||
}
|
||||
|
||||
if (part === lab3TerminalToken) {
|
||||
return <Lab3TerminalFrame key={`lab3-terminal-${index}`} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user