fix: Allow for human interrupt to be passed without array
This commit is contained in:
@@ -100,6 +100,7 @@ export function ThreadActionsView({
|
||||
|
||||
const threadTitle = interrupt.action_request.action || "Unknown";
|
||||
const actionsDisabled = loading || streaming;
|
||||
const ignoreAllowed = interrupt.config.allow_ignore;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col min-h-full w-full gap-9">
|
||||
@@ -138,14 +139,16 @@ export function ThreadActionsView({
|
||||
>
|
||||
Mark as Resolved
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="text-gray-800 border-gray-500 font-normal bg-white"
|
||||
onClick={handleIgnore}
|
||||
disabled={actionsDisabled}
|
||||
>
|
||||
Ignore
|
||||
</Button>
|
||||
{ignoreAllowed && (
|
||||
<Button
|
||||
variant="outline"
|
||||
className="text-gray-800 border-gray-500 font-normal bg-white"
|
||||
onClick={handleIgnore}
|
||||
disabled={actionsDisabled}
|
||||
>
|
||||
Ignore
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Actions */}
|
||||
|
||||
@@ -5,10 +5,11 @@ import { HumanInterrupt } from "@langchain/langgraph/prebuilt";
|
||||
import { useStreamContext } from "@/providers/Stream";
|
||||
|
||||
interface ThreadViewProps {
|
||||
interrupt: HumanInterrupt;
|
||||
interrupt: HumanInterrupt | HumanInterrupt[];
|
||||
}
|
||||
|
||||
export function ThreadView({ interrupt }: ThreadViewProps) {
|
||||
const interruptObj = Array.isArray(interrupt) ? interrupt[0] : interrupt;
|
||||
const thread = useStreamContext();
|
||||
const [showDescription, setShowDescription] = useState(false);
|
||||
const [showState, setShowState] = useState(false);
|
||||
@@ -39,13 +40,13 @@ export function ThreadView({ interrupt }: ThreadViewProps) {
|
||||
{showSidePanel ? (
|
||||
<StateView
|
||||
handleShowSidePanel={handleShowSidePanel}
|
||||
description={interrupt.description}
|
||||
description={interruptObj.description}
|
||||
values={thread.values}
|
||||
view={showState ? "state" : "description"}
|
||||
/>
|
||||
) : (
|
||||
<ThreadActionsView
|
||||
interrupt={interrupt}
|
||||
interrupt={interruptObj}
|
||||
handleShowSidePanel={handleShowSidePanel}
|
||||
showState={showState}
|
||||
showDescription={showDescription}
|
||||
|
||||
@@ -131,7 +131,7 @@ export function AssistantMessage({
|
||||
|
||||
<CustomComponent message={message} thread={thread} />
|
||||
{isAgentInboxInterruptSchema(interrupt?.value) && isLastMessage && (
|
||||
<ThreadView interrupt={interrupt.value[0]} />
|
||||
<ThreadView interrupt={interrupt.value} />
|
||||
)}
|
||||
<div
|
||||
className={cn(
|
||||
|
||||
Reference in New Issue
Block a user