Commit ed5a111
authored
fix(component,ai,gemini): correct text-based documents logic (#1103)
Because
- The previous implementation extracted text content using `doc.Text()`
for text-based documents but Gemini actually supports plain text, making
`doc.Text()` unnecessary.
This commit
- Updates text-based document processing to use base64 encoding like
PDFs for consistent handling
- Removes the `doc.Text()` extraction step that could cause processing
failures
- Ensures both PDFs and text-based documents (TXT, Markdown, HTML, XML,
etc.) are handled uniformly by passing base64 data directly to the
Gemini API
- Maintains proper MIME type detection by using the actual `contentType`
instead of hardcoded values1 parent a82d155 commit ed5a111
1 file changed
+5
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | | - | |
545 | | - | |
546 | | - | |
| 544 | + | |
| 545 | + | |
547 | 546 | | |
548 | | - | |
| 547 | + | |
549 | 548 | | |
550 | | - | |
551 | | - | |
| 549 | + | |
| 550 | + | |
552 | 551 | | |
553 | 552 | | |
554 | 553 | | |
| |||
0 commit comments