getName method

String getName()

Implementation

String getName() {
  if (documentData?.action != null) {
    return toolName.replaceAll("_", " ").capitalize! +
        (" (${documentData!.action!.replaceAll("_", " ").capitalize})");
  }
  if (toDoListData?.action != null) {
    if (toDoListData?.actionParameter != null && toDoListData?.actionParameter != 0 &&
        toDoListData!.tasks.length >= toDoListData!.actionParameter!) {
      return "#${toDoListData!.actionParameter!} ${toDoListData!.tasks[toDoListData!.actionParameter! - 1].task}";
    }
    return "${toolName.replaceAll("_", " ").capitalize!}: (${toDoListData!.action!.replaceAll("_", " ").capitalize})";
  }
  if (webSearchData != null) {
    return "${toolName.replaceAll("_", " ").capitalize!}: (${webSearchData!.type}) ${webSearchData!.query}";
  }
  if (browserUseData != null) {
    return browserUseData!.getBrowserUseActionName();
  }
  if (webReaderData != null) {
    return "${toolName.replaceAll("_", " ").capitalize!}: ${webReaderData!.url}";
  }
  return toolName.replaceAll("_", " ").capitalize ?? toolName;
}