feat: made unachieve norm possible
also small fix of formatting keywords said -> keyword said in plan as we are only able to detect single keywords (multiple keywords are possible with inferred beliefs) ref: N25B-400
This commit is contained in:
@@ -9,7 +9,7 @@ const sendUserInterrupt = async (type: string, context: string) => {
|
||||
const response = await fetch("http://localhost:8000/button_pressed", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ type, context }),
|
||||
body: JSON.stringify({type, context}),
|
||||
});
|
||||
if (!response.ok) throw new Error("Backend response error");
|
||||
console.log(`Interrupt Sent - Type: ${type}, Context: ${context}`);
|
||||
@@ -134,13 +134,20 @@ export const StatusList: React.FC<StatusListProps> = ({
|
||||
if (item.id === undefined) return null;
|
||||
const isActive = !!activeIds[item.id];
|
||||
const showIndicator = type !== 'norm';
|
||||
const canOverride = showIndicator && !isActive;
|
||||
const canOverride = showIndicator && !isActive || (type === 'cond_norm' && isActive);
|
||||
|
||||
const isCurrentGoal = type === 'goal' && idx === currentGoalIndex;
|
||||
|
||||
const handleOverrideClick = () => {
|
||||
if (!canOverride) return;
|
||||
sendUserInterrupt("override", String(item.id));
|
||||
if (type === 'cond_norm' && isActive){
|
||||
{/* Unachieve conditional norm */}
|
||||
sendUserInterrupt("override_unachieve", String(item.id));
|
||||
}
|
||||
else {
|
||||
|
||||
sendUserInterrupt("override", String(item.id));
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -139,7 +139,7 @@ const MonitoringPage: React.FC = () => {
|
||||
|
||||
let prefix = "";
|
||||
if (t.condition && typeof t.condition !== "string" && "keyword" in t.condition && typeof t.condition.keyword === "string") {
|
||||
prefix = `if keywords said: "${t.condition.keyword}"`;
|
||||
prefix = `if keyword said: "${t.condition.keyword}"`;
|
||||
} else if (t.condition && typeof t.condition !== "string" && "name" in t.condition && typeof t.condition.name === "string") {
|
||||
prefix = `if LLM belief: ${t.condition.name}`;
|
||||
} else { //fallback
|
||||
@@ -183,7 +183,7 @@ const MonitoringPage: React.FC = () => {
|
||||
label: (() => {
|
||||
let prefix = "";
|
||||
if (n.condition && typeof n.condition !== "string" && "keyword" in n.condition && typeof n.condition.keyword === "string") {
|
||||
prefix = `if keywords said: "${n.condition.keyword}"`;
|
||||
prefix = `if keyword said: "${n.condition.keyword}"`;
|
||||
} else if (n.condition && typeof n.condition !== "string" && "name" in n.condition && typeof n.condition.name === "string") {
|
||||
prefix = `if LLM belief: ${n.condition.name}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user