diff --git a/webapp/_webapp/src/components/message-entry-container/tools/review-paper.tsx b/webapp/_webapp/src/components/message-entry-container/tools/review-paper.tsx new file mode 100644 index 00000000..c0cabbc7 --- /dev/null +++ b/webapp/_webapp/src/components/message-entry-container/tools/review-paper.tsx @@ -0,0 +1,72 @@ +import { cn } from "@heroui/react"; +import { JsonRpcResult } from "./utils/common"; +import { LoadingIndicator } from "../../loading-indicator"; +import MarkdownComponent from "../../markdown"; +import { useState } from "react"; + +type ReviewPaperProps = { + jsonRpcResult: JsonRpcResult; + preparing: boolean; + animated: boolean; +}; + +export const ReviewPaperCard = ({ jsonRpcResult, preparing, animated }: ReviewPaperProps) => { + const [isCollapsed, setIsCollapsed] = useState(false); + + if (preparing) { + return ( +
+
+

Reviewing Paper

+
+ +
+ ); + } + + const toggleCollapse = () => { + setIsCollapsed(!isCollapsed); + }; + + return ( +
+
+

review_paper

+ +
+ +
+ {jsonRpcResult.result && ( +
+ + ℹ️ Review paper is currently scaled back to balance cost. Presently it identifies issues in Title, Abstract, and Introduction. + We are working to support the full review flow again. + If you find the input might not be properly passed, try highlighting the relevant sections and adding to chat. + +
+ )} + + {jsonRpcResult.error &&
{jsonRpcResult.error.message}
} +
+
+ ); +}; diff --git a/webapp/_webapp/src/components/message-entry-container/tools/tools.tsx b/webapp/_webapp/src/components/message-entry-container/tools/tools.tsx index 96752df2..cb641bbc 100644 --- a/webapp/_webapp/src/components/message-entry-container/tools/tools.tsx +++ b/webapp/_webapp/src/components/message-entry-container/tools/tools.tsx @@ -5,6 +5,7 @@ import { GreetingCard } from "./greeting"; import { ErrorToolCard } from "./error"; import { AlwaysExceptionCard } from "./always-exception"; import { JsonRpc } from "./jsonrpc"; +import { ReviewPaperCard } from "./review-paper"; import { parseJsonRpcResult, UNKNOWN_JSONRPC_RESULT } from "./utils/common"; type ToolsProps = { @@ -47,6 +48,14 @@ export default function Tools({ messageId, functionName, message, error, prepari return ; } else if (functionName === "always_exception") { return ; + } else if (functionName === "review_paper") { + return ( + + ); } else if (XTRA_MCP_TOOL_NAMES.includes(functionName)) { return (