getFilePathFromInput function

String? getFilePathFromInput(
  1. String toolName,
  2. Map<String, dynamic>? toolInput
)

Get the file path from a tool input.

Implementation

String? getFilePathFromInput(String toolName, Map<String, dynamic>? toolInput) {
  if (toolInput == null) return null;
  switch (toolName) {
    case 'FileRead':
    case 'FileEdit':
    case 'FileWrite':
      return toolInput['file_path'] as String?;
    default:
      return null;
  }
}