| 148 | } |
| 149 | |
| 150 | func getMaxFileSize(mimeType, mode string) (int, string) { |
| 151 | if mimeType == "application/pdf" { |
| 152 | return 5 * 1024 * 1024, "5MB" |
| 153 | } |
| 154 | if strings.HasPrefix(mimeType, "image/") { |
| 155 | return 7 * 1024 * 1024, "7MB" |
| 156 | } |
| 157 | if mode == ModeHTMLContent || mode == ModeHTMLFull { |
| 158 | return 500 * 1024, "500KB" |
| 159 | } |
| 160 | return 200 * 1024, "200KB" |
| 161 | } |
| 162 | |
| 163 | // SummarizeFile reads a file and generates a summary using Google's Generative AI. |
| 164 | // It supports images, PDFs, and text files based on the limits defined in wshcmd-ai.go. |