mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 14:10:37 -07:00
fix(audio): improve reading of audio files (#14658)
This commit is contained in:
@@ -36,8 +36,9 @@ glob patterns.
|
||||
## 2. `read_file` (ReadFile)
|
||||
|
||||
`read_file` reads and returns the content of a specified file. This tool handles
|
||||
text, images (PNG, JPG, GIF, WEBP, SVG, BMP), and PDF files. For text files, it
|
||||
can read specific line ranges. Other binary file types are generally skipped.
|
||||
text, images (PNG, JPG, GIF, WEBP, SVG, BMP), audio files (MP3, WAV, AIFF, AAC,
|
||||
OGG, FLAC), and PDF files. For text files, it can read specific line ranges.
|
||||
Other binary file types are generally skipped.
|
||||
|
||||
- **Tool name:** `read_file`
|
||||
- **Display name:** ReadFile
|
||||
@@ -53,16 +54,16 @@ can read specific line ranges. Other binary file types are generally skipped.
|
||||
- For text files: Returns the content. If `offset` and `limit` are used,
|
||||
returns only that slice of lines. Indicates if content was truncated due to
|
||||
line limits or line length limits.
|
||||
- For image and PDF files: Returns the file content as a base64-encoded data
|
||||
structure suitable for model consumption.
|
||||
- For image, audio, and PDF files: Returns the file content as a
|
||||
base64-encoded data structure suitable for model consumption.
|
||||
- For other binary files: Attempts to identify and skip them, returning a
|
||||
message indicating it's a generic binary file.
|
||||
- **Output:** (`llmContent`):
|
||||
- For text files: The file content, potentially prefixed with a truncation
|
||||
message (e.g.,
|
||||
`[File content truncated: showing lines 1-100 of 500 total lines...]\nActual file content...`).
|
||||
- For image/PDF files: An object containing `inlineData` with `mimeType` and
|
||||
base64 `data` (e.g.,
|
||||
- For image/audio/PDF files: An object containing `inlineData` with `mimeType`
|
||||
and base64 `data` (e.g.,
|
||||
`{ inlineData: { mimeType: 'image/png', data: 'base64encodedstring' } }`).
|
||||
- For other binary files: A message like
|
||||
`Cannot display content of binary file: /path/to/data.bin`.
|
||||
|
||||
Reference in New Issue
Block a user