Utility that determines whether a chat message type represents a tool/plugin/function/MCP call, used to style or filter tool-related messages in chat UI.
// Source: https://github.com/agentscope-ai/QwenPaw | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import { AgentScopeRuntimeMessageType } from "@agentscope-ai/chat";
const TOOL_LIKE_RESPONSE_TYPES = new Set<AgentScopeRuntimeMessageType>([
AgentScopeRuntimeMessageType.PLUGIN_CALL,
AgentScopeRuntimeMessageType.PLUGIN_CALL_OUTPUT,
AgentScopeRuntimeMessageType.TOOL_CALL,
AgentScopeRuntimeMessageType.TOOL_CALL_OUTPUT,
AgentScopeRuntimeMessageType.FUNCTION_CALL,
AgentScopeRuntimeMessageType.FUNCTION_CALL_OUTPUT,
AgentScopeRuntimeMessageType.COMPONENT_CALL,
AgentScopeRuntimeMessageType.COMPONENT_CALL_OUTPUT,
AgentScopeRuntimeMessageType.MCP_CALL,
AgentScopeRuntimeM
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key