File Analysis
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
contents | array | ✅ Yes | - | Contains the content to be analyzed, including text and file references. |
parts | array | ✅ Yes | - | Parts of the content, can include text and file data. |
text | string | ✅ Yes | - | The text prompt for the file analysis. |
fileData | object | ✅ Yes | - | The file to analyze. |
mimeType | string | ✅ Yes | - | The MIME type of the file (e.g., “application/pdf”). |
fileUri | string | ✅ Yes | - | The URL of the file to analyze. |
generationConfig | object | ❌ No | - | Generation configuration settings. |
temperature | number | ❌ No | 0.3 | Controls randomness in the response (0.0 to 1.0). |
safetySettings | array | ❌ No | - | Safety settings for content filtering. |
category | string | ✅ Yes | - | The harm category to filter. |
threshold | string | ✅ Yes | - | The threshold for blocking content (e.g., “BLOCK_MEDIUM_AND_ABOVE”). |