@assistant-ui/react
Version:
TypeScript/React library for AI Chat
14 lines • 664 B
JavaScript
export const shouldContinue = (result, humanToolNames) => {
// TODO legacy behavior -- make specifying human tool names required
if (humanToolNames === undefined) {
return (result.status?.type === "requires-action" &&
result.status.reason === "tool-calls" &&
result.content.every((c) => c.type !== "tool-call" || !!c.result));
}
return (result.status?.type === "requires-action" &&
result.status.reason === "tool-calls" &&
result.content.every((c) => c.type !== "tool-call" ||
!!c.result ||
!humanToolNames.includes(c.toolName)));
};
//# sourceMappingURL=shouldContinue.js.map