Spaces:
Sleeping
Sleeping
Delete SUPPORTED_FILE_TYPES.md
Browse files- SUPPORTED_FILE_TYPES.md +0 -368
SUPPORTED_FILE_TYPES.md
DELETED
|
@@ -1,368 +0,0 @@
|
|
| 1 |
-
# 支持的文件类型清单
|
| 2 |
-
|
| 3 |
-
本文档列出了 Gemini 支持的所有文件类型。
|
| 4 |
-
|
| 5 |
-
## 🖼️ 图片文件(Image Files)
|
| 6 |
-
|
| 7 |
-
| 格式 | 扩展名 | MIME 类型 | 支持状态 | 说明 |
|
| 8 |
-
| ---- | --------------- | --------------- | ---------- | ------------------ |
|
| 9 |
-
| PNG | `.png` | `image/png` | ✅ 完全支持 | 无损压缩,支持透明 |
|
| 10 |
-
| JPEG | `.jpg`, `.jpeg` | `image/jpeg` | ✅ 完全支持 | 有损压缩,照片常用 |
|
| 11 |
-
| WebP | `.webp` | `image/webp` | ✅ 完全支持 | 现代格式,体积小 |
|
| 12 |
-
| GIF | `.gif` | `image/gif` | ✅ 完全支持 | 支持动画 |
|
| 13 |
-
| BMP | `.bmp` | `image/bmp` | ✅ 支持 | Windows 位图 |
|
| 14 |
-
| TIFF | `.tiff`, `.tif` | `image/tiff` | ✅ 支持 | 高质量图像 |
|
| 15 |
-
| SVG | `.svg` | `image/svg+xml` | ✅ 支持 | 矢量图形 |
|
| 16 |
-
| ICO | `.ico` | `image/x-icon` | ✅ 支持 | 图标文件 |
|
| 17 |
-
| HEIC | `.heic` | `image/heic` | ✅ 支持 | Apple 高效图像格式 |
|
| 18 |
-
| HEIF | `.heif` | `image/heif` | ✅ 支持 | 高效图像格式 |
|
| 19 |
-
| AVIF | `.avif` | `image/avif` | ✅ 支持 | 新一代图像格式 |
|
| 20 |
-
|
| 21 |
-
## 📄 文档文件(Document Files)
|
| 22 |
-
|
| 23 |
-
| 格式 | 扩展名 | MIME 类型 | 支持状态 | 说明 |
|
| 24 |
-
| -------- | --------------- | ------------------------------- | ---------- | ---------------------- |
|
| 25 |
-
| PDF | `.pdf` | `application/pdf` | ✅ 完全支持 | 可提取文本、图片、表格 |
|
| 26 |
-
| 纯文本 | `.txt` | `text/plain` | ✅ 完全支持 | 纯文本文件 |
|
| 27 |
-
| Markdown | `.md` | `text/markdown` | ✅ 完全支持 | 标记语言 |
|
| 28 |
-
| HTML | `.html`, `.htm` | `text/html` | ✅ 完全支持 | 网页文件 |
|
| 29 |
-
| XML | `.xml` | `text/xml` 或 `application/xml` | ✅ 完全支持 | 结构化数据 |
|
| 30 |
-
| CSV | `.csv` | `text/csv` | ✅ 完全支持 | 表格数据 |
|
| 31 |
-
| TSV | `.tsv` | `text/tab-separated-values` | ✅ 支持 | 制表符分隔 |
|
| 32 |
-
| RTF | `.rtf` | `application/rtf` | ✅ 支持 | 富文本格式 |
|
| 33 |
-
| LaTeX | `.tex` | `text/x-tex` | ✅ 支持 | 科学文档 |
|
| 34 |
-
|
| 35 |
-
## 📊 Microsoft Office 文档
|
| 36 |
-
|
| 37 |
-
| 格式 | 扩展名 | MIME 类型 | 支持状态 | 说明 |
|
| 38 |
-
| --------------- | ------- | --------------------------------------------------------------------------- | -------- | ---------------- |
|
| 39 |
-
| Word (新) | `.docx` | `application/vnd.openxmlformats-officedocument.wordprocessingml.document` | ✅ 支持 | 可提取文本和格式 |
|
| 40 |
-
| Word (旧) | `.doc` | `application/msword` | ✅ 支持 | 旧版 Word 文档 |
|
| 41 |
-
| Excel (新) | `.xlsx` | `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` | ✅ 支持 | 可读取表格数据 |
|
| 42 |
-
| Excel (旧) | `.xls` | `application/vnd.ms-excel` | ✅ 支持 | 旧版 Excel 文档 |
|
| 43 |
-
| PowerPoint (新) | `.pptx` | `application/vnd.openxmlformats-officedocument.presentationml.presentation` | ✅ 支持 | 可提取文本和图片 |
|
| 44 |
-
| PowerPoint (旧) | `.ppt` | `application/vnd.ms-powerpoint` | ✅ 支持 | 旧版 PPT 文档 |
|
| 45 |
-
|
| 46 |
-
## 📝 Google Workspace 文档
|
| 47 |
-
|
| 48 |
-
| 格式 | 扩展名 | MIME 类型 | 支持状态 | 说明 |
|
| 49 |
-
| ------------- | ---------- | ------------------------------------------ | -------- | ------------ |
|
| 50 |
-
| Google Docs | `.gdoc` | `application/vnd.google-apps.document` | ✅ 支持 | 需要导出链接 |
|
| 51 |
-
| Google Sheets | `.gsheet` | `application/vnd.google-apps.spreadsheet` | ✅ 支持 | 需要导出链接 |
|
| 52 |
-
| Google Slides | `.gslides` | `application/vnd.google-apps.presentation` | ✅ 支持 | 需要导出链接 |
|
| 53 |
-
|
| 54 |
-
## 💻 代码文件(Code Files)
|
| 55 |
-
|
| 56 |
-
| 格式 | 扩展名 | MIME 类型 | 支持状态 | 说明 |
|
| 57 |
-
| ---------- | --------------------- | --------------------------------------------- | ---------- | --------------- |
|
| 58 |
-
| Python | `.py` | `text/x-python` 或 `application/x-python` | ✅ 完全支持 | Python 代码 |
|
| 59 |
-
| JavaScript | `.js` | `text/javascript` 或 `application/javascript` | ✅ 完全支持 | JS 代码 |
|
| 60 |
-
| TypeScript | `.ts` | `text/typescript` 或 `application/typescript` | ✅ 完全支持 | TS 代码 |
|
| 61 |
-
| JSX/TSX | `.jsx`, `.tsx` | `text/jsx`, `text/tsx` | ✅ 支持 | React 组件 |
|
| 62 |
-
| Java | `.java` | `text/x-java-source` | ✅ 完全支持 | Java 代码 |
|
| 63 |
-
| C | `.c` | `text/x-c` | ✅ 支持 | C 语言 |
|
| 64 |
-
| C++ | `.cpp`, `.cc`, `.cxx` | `text/x-c++` | ✅ 支持 | C++ 代码 |
|
| 65 |
-
| C# | `.cs` | `text/x-csharp` | ✅ 支持 | C# 代码 |
|
| 66 |
-
| Go | `.go` | `text/x-go` | ✅ 支持 | Go 语言 |
|
| 67 |
-
| Rust | `.rs` | `text/x-rust` | ✅ 支持 | Rust 代码 |
|
| 68 |
-
| PHP | `.php` | `text/x-php` 或 `application/x-php` | ✅ 支持 | PHP 代码 |
|
| 69 |
-
| Ruby | `.rb` | `text/x-ruby` | ✅ 支持 | Ruby 代码 |
|
| 70 |
-
| Swift | `.swift` | `text/x-swift` | ✅ 支持 | Swift 代码 |
|
| 71 |
-
| Kotlin | `.kt` | `text/x-kotlin` | ✅ 支持 | Kotlin 代码 |
|
| 72 |
-
| Scala | `.scala` | `text/x-scala` | ✅ 支持 | Scala 代码 |
|
| 73 |
-
| Shell | `.sh`, `.bash` | `text/x-shellscript` | ✅ 支持 | Shell 脚本 |
|
| 74 |
-
| PowerShell | `.ps1` | `text/x-powershell` | ✅ 支持 | PowerShell 脚本 |
|
| 75 |
-
| SQL | `.sql` | `text/x-sql` 或 `application/sql` | ✅ 支持 | SQL 脚本 |
|
| 76 |
-
| R | `.r`, `.R` | `text/x-r` | ✅ 支持 | R 语言 |
|
| 77 |
-
| MATLAB | `.m` | `text/x-matlab` | ✅ 支持 | MATLAB 代码 |
|
| 78 |
-
|
| 79 |
-
## 🎨 Web 开发文件
|
| 80 |
-
|
| 81 |
-
| 格式 | 扩展名 | MIME 类型 | 支持状态 | 说明 |
|
| 82 |
-
| --------- | ---------------- | ----------------------------------- | ---------- | ------------ |
|
| 83 |
-
| CSS | `.css` | `text/css` | ✅ 完全支持 | 样式表 |
|
| 84 |
-
| SCSS/Sass | `.scss`, `.sass` | `text/x-scss`, `text/x-sass` | ✅ 支持 | CSS 预处理器 |
|
| 85 |
-
| LESS | `.less` | `text/x-less` | ✅ 支持 | CSS 预处理器 |
|
| 86 |
-
| JSON | `.json` | `application/json` | ✅ 完全支持 | 数据交换格式 |
|
| 87 |
-
| YAML | `.yaml`, `.yml` | `text/yaml` 或 `application/x-yaml` | ✅ 支持 | 配置文件 |
|
| 88 |
-
| TOML | `.toml` | `application/toml` | ✅ 支持 | 配置文件 |
|
| 89 |
-
| Vue | `.vue` | `text/x-vue` | ✅ 支持 | Vue 组件 |
|
| 90 |
-
| Svelte | `.svelte` | `text/x-svelte` | ✅ 支持 | Svelte 组件 |
|
| 91 |
-
|
| 92 |
-
## 🎵 音频文件(Audio Files)
|
| 93 |
-
|
| 94 |
-
| 格式 | 扩展名 | MIME 类型 | 支持状态 | 说明 |
|
| 95 |
-
| ---- | --------------- | ---------------------------- | ---------- | ------------ |
|
| 96 |
-
| MP3 | `.mp3` | `audio/mpeg` 或 `audio/mp3` | ✅ 完全支持 | 最常用格式 |
|
| 97 |
-
| WAV | `.wav` | `audio/wav` 或 `audio/x-wav` | ✅ 完全支持 | 无损格式 |
|
| 98 |
-
| AAC | `.aac` | `audio/aac` | ✅ 支持 | 高质量压缩 |
|
| 99 |
-
| M4A | `.m4a` | `audio/m4a` 或 `audio/mp4` | ✅ 支持 | Apple 格式 |
|
| 100 |
-
| OGG | `.ogg` | `audio/ogg` | ✅ 支持 | 开源格式 |
|
| 101 |
-
| FLAC | `.flac` | `audio/flac` | ✅ 支持 | 无损压缩 |
|
| 102 |
-
| AIFF | `.aiff`, `.aif` | `audio/aiff` | ✅ 支持 | Apple 格式 |
|
| 103 |
-
| WMA | `.wma` | `audio/x-ms-wma` | ✅ 支持 | Windows 格式 |
|
| 104 |
-
| OPUS | `.opus` | `audio/opus` | ✅ 支持 | 高效编码 |
|
| 105 |
-
| AMR | `.amr` | `audio/amr` | ✅ 支持 | 语音编码 |
|
| 106 |
-
|
| 107 |
-
**音频功能**:
|
| 108 |
-
- 🎤 语音转文字(转录)
|
| 109 |
-
- 🗣️ 说话人识别
|
| 110 |
-
- 🌍 语言识别
|
| 111 |
-
- 😊 情感分析
|
| 112 |
-
- 🎵 音乐分析
|
| 113 |
-
|
| 114 |
-
## 🎬 视频文件(Video Files)
|
| 115 |
-
|
| 116 |
-
| 格式 | 扩展名 | MIME 类型 | 支持状态 | 说明 |
|
| 117 |
-
| ---- | --------------- | ------------------ | ---------- | ------------ |
|
| 118 |
-
| MP4 | `.mp4` | `video/mp4` | ✅ 完全支持 | 最常用格式 |
|
| 119 |
-
| MOV | `.mov` | `video/quicktime` | ✅ 完全支持 | Apple 格式 |
|
| 120 |
-
| AVI | `.avi` | `video/x-msvideo` | ✅ 支持 | Windows 格式 |
|
| 121 |
-
| MPEG | `.mpeg`, `.mpg` | `video/mpeg` | ✅ 支持 | 标准格式 |
|
| 122 |
-
| WebM | `.webm` | `video/webm` | ✅ 支持 | 网页格式 |
|
| 123 |
-
| FLV | `.flv` | `video/x-flv` | ✅ 支持 | Flash 格式 |
|
| 124 |
-
| WMV | `.wmv` | `video/x-ms-wmv` | ✅ 支持 | Windows 格式 |
|
| 125 |
-
| MKV | `.mkv` | `video/x-matroska` | ✅ 支持 | 开源容器 |
|
| 126 |
-
| 3GPP | `.3gp`, `.3gpp` | `video/3gpp` | ✅ 支持 | 移动格式 |
|
| 127 |
-
| M4V | `.m4v` | `video/x-m4v` | ✅ 支持 | Apple 格式 |
|
| 128 |
-
|
| 129 |
-
**视频功能**:
|
| 130 |
-
- 🎬 场景识别
|
| 131 |
-
- 👤 人物检测
|
| 132 |
-
- 🏷️ 对象识别
|
| 133 |
-
- 📝 字幕生成
|
| 134 |
-
- 🎯 动作识别
|
| 135 |
-
- 📊 内容分析
|
| 136 |
-
|
| 137 |
-
## 📦 数据文件(Data Files)
|
| 138 |
-
|
| 139 |
-
| 格式 | 扩展名 | MIME 类型 | 支持状态 | 说明 |
|
| 140 |
-
| ------- | ---------- | --------------------------- | ---------- | ----------- |
|
| 141 |
-
| JSON | `.json` | `application/json` | ✅ 完全支持 | 数据交换 |
|
| 142 |
-
| JSONL | `.jsonl` | `application/jsonlines` | ✅ 支持 | 行分隔 JSON |
|
| 143 |
-
| CSV | `.csv` | `text/csv` | ✅ 完全支持 | 表格数据 |
|
| 144 |
-
| TSV | `.tsv` | `text/tab-separated-values` | ✅ 支持 | 制表符分隔 |
|
| 145 |
-
| Parquet | `.parquet` | `application/x-parquet` | ⚠️ 可能支持 | 列式存储 |
|
| 146 |
-
| Avro | `.avro` | `application/avro` | ⚠️ 可能支持 | 数据序列化 |
|
| 147 |
-
|
| 148 |
-
## 🗜️ 压缩文件(Archive Files)
|
| 149 |
-
|
| 150 |
-
| 格式 | 扩展名 | MIME 类型 | 支持状态 | 说明 |
|
| 151 |
-
| ---- | ------ | ------------------------------ | ---------- | -------- |
|
| 152 |
-
| ZIP | `.zip` | `application/zip` | ⚠️ 部分支持 | 需要解压 |
|
| 153 |
-
| RAR | `.rar` | `application/x-rar-compressed` | ❌ 不支持 | 需要解压 |
|
| 154 |
-
| 7Z | `.7z` | `application/x-7z-compressed` | ❌ 不支持 | 需要解压 |
|
| 155 |
-
| TAR | `.tar` | `application/x-tar` | ⚠️ 部分支持 | 需要解压 |
|
| 156 |
-
| GZ | `.gz` | `application/gzip` | ⚠️ 部分支持 | 需要解压 |
|
| 157 |
-
|
| 158 |
-
## 🔧 配置文件(Configuration Files)
|
| 159 |
-
|
| 160 |
-
| 格式 | 扩展名 | MIME 类型 | 支持状态 | 说明 |
|
| 161 |
-
| ---------- | --------------- | ------------------ | ---------- | --------- |
|
| 162 |
-
| YAML | `.yaml`, `.yml` | `text/yaml` | ✅ 完全支持 | 配置文件 |
|
| 163 |
-
| TOML | `.toml` | `application/toml` | ✅ 支持 | 配置文件 |
|
| 164 |
-
| INI | `.ini` | `text/plain` | ✅ 支持 | 配置文件 |
|
| 165 |
-
| ENV | `.env` | `text/plain` | ✅ 支持 | 环境变量 |
|
| 166 |
-
| Properties | `.properties` | `text/plain` | ✅ 支持 | Java 配置 |
|
| 167 |
-
|
| 168 |
-
## 📚 电子书格式(E-book Formats)
|
| 169 |
-
|
| 170 |
-
| 格式 | 扩展名 | MIME 类型 | 支持状态 | 说明 |
|
| 171 |
-
| ---- | ------- | -------------------------------- | ---------- | ----------- |
|
| 172 |
-
| EPUB | `.epub` | `application/epub+zip` | ⚠️ 可能支持 | 电子书格式 |
|
| 173 |
-
| MOBI | `.mobi` | `application/x-mobipocket-ebook` | ⚠️ 可能支持 | Kindle 格式 |
|
| 174 |
-
|
| 175 |
-
## 📊 文件大小限制
|
| 176 |
-
|
| 177 |
-
| 文件类型 | 推荐大小 | 最大大小 | 处理时间 |
|
| 178 |
-
| ----------- | -------- | -------- | ---------- |
|
| 179 |
-
| 图片 | < 5 MB | ~20 MB | 秒级 |
|
| 180 |
-
| PDF | < 10 MB | ~100 MB | 秒到分钟 |
|
| 181 |
-
| Office 文档 | < 10 MB | ~50 MB | 秒到分钟 |
|
| 182 |
-
| 文本/代码 | < 1 MB | ~10 MB | 秒级 |
|
| 183 |
-
| 音频 | < 20 MB | ~100 MB | 分钟级 |
|
| 184 |
-
| 视频 | < 100 MB | ~2 GB | 分钟到小时 |
|
| 185 |
-
|
| 186 |
-
## 🎯 使用示例
|
| 187 |
-
|
| 188 |
-
### 1. 图片文件
|
| 189 |
-
|
| 190 |
-
```bash
|
| 191 |
-
curl -X POST http://localhost:7860/v1/v1/chat/completions \
|
| 192 |
-
-H "Content-Type: application/json" \
|
| 193 |
-
-H "Authorization: Bearer your_api_key" \
|
| 194 |
-
-d '{
|
| 195 |
-
"model": "gemini-2.5-pro",
|
| 196 |
-
"messages": [{
|
| 197 |
-
"role": "user",
|
| 198 |
-
"content": [
|
| 199 |
-
{"type": "text", "text": "描述这张图片"},
|
| 200 |
-
{"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."}}
|
| 201 |
-
]
|
| 202 |
-
}]
|
| 203 |
-
}'
|
| 204 |
-
```
|
| 205 |
-
|
| 206 |
-
### 2. PDF 文档
|
| 207 |
-
|
| 208 |
-
```bash
|
| 209 |
-
curl -X POST http://localhost:7860/v1/v1/chat/completions \
|
| 210 |
-
-H "Content-Type: application/json" \
|
| 211 |
-
-H "Authorization: Bearer your_api_key" \
|
| 212 |
-
-d '{
|
| 213 |
-
"model": "gemini-2.5-pro",
|
| 214 |
-
"messages": [{
|
| 215 |
-
"role": "user",
|
| 216 |
-
"content": [
|
| 217 |
-
{"type": "text", "text": "总结这个PDF的主要内容"},
|
| 218 |
-
{"type": "image_url", "image_url": {"url": "https://example.com/report.pdf"}}
|
| 219 |
-
]
|
| 220 |
-
}]
|
| 221 |
-
}'
|
| 222 |
-
```
|
| 223 |
-
|
| 224 |
-
### 3. Office 文档
|
| 225 |
-
|
| 226 |
-
```bash
|
| 227 |
-
# Word 文档
|
| 228 |
-
curl -X POST http://localhost:7860/v1/v1/chat/completions \
|
| 229 |
-
-H "Content-Type: application/json" \
|
| 230 |
-
-H "Authorization: Bearer your_api_key" \
|
| 231 |
-
-d '{
|
| 232 |
-
"model": "gemini-2.5-pro",
|
| 233 |
-
"messages": [{
|
| 234 |
-
"role": "user",
|
| 235 |
-
"content": [
|
| 236 |
-
{"type": "text", "text": "总结这个Word文档的内容"},
|
| 237 |
-
{"type": "image_url", "image_url": {"url": "https://example.com/document.docx"}}
|
| 238 |
-
]
|
| 239 |
-
}]
|
| 240 |
-
}'
|
| 241 |
-
|
| 242 |
-
# Excel 表格
|
| 243 |
-
curl -X POST http://localhost:7860/v1/v1/chat/completions \
|
| 244 |
-
-H "Content-Type: application/json" \
|
| 245 |
-
-H "Authorization: Bearer your_api_key" \
|
| 246 |
-
-d '{
|
| 247 |
-
"model": "gemini-2.5-pro",
|
| 248 |
-
"messages": [{
|
| 249 |
-
"role": "user",
|
| 250 |
-
"content": [
|
| 251 |
-
{"type": "text", "text": "分析这个Excel表格的数据"},
|
| 252 |
-
{"type": "image_url", "image_url": {"url": "https://example.com/data.xlsx"}}
|
| 253 |
-
]
|
| 254 |
-
}]
|
| 255 |
-
}'
|
| 256 |
-
|
| 257 |
-
# PowerPoint 演示文稿
|
| 258 |
-
curl -X POST http://localhost:7860/v1/v1/chat/completions \
|
| 259 |
-
-H "Content-Type: application/json" \
|
| 260 |
-
-H "Authorization: Bearer your_api_key" \
|
| 261 |
-
-d '{
|
| 262 |
-
"model": "gemini-2.5-pro",
|
| 263 |
-
"messages": [{
|
| 264 |
-
"role": "user",
|
| 265 |
-
"content": [
|
| 266 |
-
{"type": "text", "text": "总结这个PPT的主要内容"},
|
| 267 |
-
{"type": "image_url", "image_url": {"url": "https://example.com/presentation.pptx"}}
|
| 268 |
-
]
|
| 269 |
-
}]
|
| 270 |
-
}'
|
| 271 |
-
```
|
| 272 |
-
|
| 273 |
-
### 4. 音频文件
|
| 274 |
-
|
| 275 |
-
```bash
|
| 276 |
-
curl -X POST http://localhost:7860/v1/v1/chat/completions \
|
| 277 |
-
-H "Content-Type: application/json" \
|
| 278 |
-
-H "Authorization: Bearer your_api_key" \
|
| 279 |
-
-d '{
|
| 280 |
-
"model": "gemini-2.5-pro",
|
| 281 |
-
"messages": [{
|
| 282 |
-
"role": "user",
|
| 283 |
-
"content": [
|
| 284 |
-
{"type": "text", "text": "转录这段音频并总结内容"},
|
| 285 |
-
{"type": "image_url", "image_url": {"url": "https://example.com/audio.mp3"}}
|
| 286 |
-
]
|
| 287 |
-
}]
|
| 288 |
-
}'
|
| 289 |
-
```
|
| 290 |
-
|
| 291 |
-
### 5. 视频文件
|
| 292 |
-
|
| 293 |
-
```bash
|
| 294 |
-
curl -X POST http://localhost:7860/v1/v1/chat/completions \
|
| 295 |
-
-H "Content-Type: application/json" \
|
| 296 |
-
-H "Authorization: Bearer your_api_key" \
|
| 297 |
-
-d '{
|
| 298 |
-
"model": "gemini-2.5-pro",
|
| 299 |
-
"messages": [{
|
| 300 |
-
"role": "user",
|
| 301 |
-
"content": [
|
| 302 |
-
{"type": "text", "text": "描述这个视频的主要场景"},
|
| 303 |
-
{"type": "image_url", "image_url": {"url": "https://example.com/video.mp4"}}
|
| 304 |
-
]
|
| 305 |
-
}]
|
| 306 |
-
}'
|
| 307 |
-
```
|
| 308 |
-
|
| 309 |
-
### 6. 代码文件
|
| 310 |
-
|
| 311 |
-
```bash
|
| 312 |
-
curl -X POST http://localhost:7860/v1/v1/chat/completions \
|
| 313 |
-
-H "Content-Type: application/json" \
|
| 314 |
-
-H "Authorization: Bearer your_api_key" \
|
| 315 |
-
-d '{
|
| 316 |
-
"model": "gemini-2.5-pro",
|
| 317 |
-
"messages": [{
|
| 318 |
-
"role": "user",
|
| 319 |
-
"content": [
|
| 320 |
-
{"type": "text", "text": "审查这段代码并提出改进建议"},
|
| 321 |
-
{"type": "image_url", "image_url": {"url": "data:text/x-python;base64,ZGVmIGhlbGxvKCk6..."}}
|
| 322 |
-
]
|
| 323 |
-
}]
|
| 324 |
-
}'
|
| 325 |
-
```
|
| 326 |
-
|
| 327 |
-
### 7. 混合多种文件
|
| 328 |
-
|
| 329 |
-
```bash
|
| 330 |
-
curl -X POST http://localhost:7860/v1/v1/chat/completions \
|
| 331 |
-
-H "Content-Type: application/json" \
|
| 332 |
-
-H "Authorization: Bearer your_api_key" \
|
| 333 |
-
-d '{
|
| 334 |
-
"model": "gemini-2.5-pro",
|
| 335 |
-
"messages": [{
|
| 336 |
-
"role": "user",
|
| 337 |
-
"content": [
|
| 338 |
-
{"type": "text", "text": "比较这些文件的内容"},
|
| 339 |
-
{"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}},
|
| 340 |
-
{"type": "image_url", "image_url": {"url": "https://example.com/document.pdf"}},
|
| 341 |
-
{"type": "image_url", "image_url": {"url": "https://example.com/audio.mp3"}}
|
| 342 |
-
]
|
| 343 |
-
}]
|
| 344 |
-
}'
|
| 345 |
-
```
|
| 346 |
-
|
| 347 |
-
## ⚠️ 重要说明
|
| 348 |
-
|
| 349 |
-
1. **实际支持范围**:Google Gemini API 的实际支持范围可能比官方文档更广,建议实际测试
|
| 350 |
-
2. **MIME 类型**:必须正确指定 MIME 类型,否则可能处理失败
|
| 351 |
-
3. **文件大小**:超大文件可能导致超时或处理失败
|
| 352 |
-
4. **处理质量**:不同文件类型的处理质量可能不同
|
| 353 |
-
5. **API 版本**:支持的文件类型可能随 API 版本变化
|
| 354 |
-
6. **字段名称**:虽然支持所有文件类型,但仍使用 `image_url` 字段(OpenAI API 标准)
|
| 355 |
-
|
| 356 |
-
## 📝 支持状态说明
|
| 357 |
-
|
| 358 |
-
- ✅ **完全支持**:经过充分测试,稳定可用
|
| 359 |
-
- ✅ **支持**:可以使用,但可能有限制
|
| 360 |
-
- ⚠️ **可能支持**:理论上支持,需要实际测试
|
| 361 |
-
- ⚠️ **部分支持**:有条件支持,可能需要特殊处理
|
| 362 |
-
- ❌ **不支持**:当前不支持或需要转换
|
| 363 |
-
|
| 364 |
-
## 🔗 相关链接
|
| 365 |
-
|
| 366 |
-
- [项目主页](https://github.com/your-repo/gemini-business2api)
|
| 367 |
-
- [API 文档](README.md)
|
| 368 |
-
- [问题反馈](https://github.com/your-repo/gemini-business2api/issues)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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