Download lib/types.ts from forrest111/image-generation-editing: direct link, hf CLI and curl.
- Browser
- Download file 732 Bytes
-
https://huggingface.co/spaces/forrest111/image-generation-editing/resolve/main/lib/types.ts
- Command line
-
hf download hf://spaces/forrest111/image-generation-editing/lib/types.ts
-
curl -L -o types.ts https://huggingface.co/spaces/forrest111/image-generation-editing/resolve/main/lib/types.ts
732 Bytes
| // Define the interface for conversation history items | |
| export interface HistoryItem { | |
| // Role can be either "user" or "model" | |
| role: "user" | "model"; | |
| // Parts can contain text and/or images | |
| parts: HistoryPart[]; | |
| } | |
| // Define the interface for history parts | |
| export interface HistoryPart { | |
| // Text content (optional) | |
| text?: string; | |
| // Image content as data URL (optional) | |
| // Format: data:image/png;base64,... or data:image/jpeg;base64,... | |
| image?: string; | |
| } | |
| // Note: When sending to the Gemini API: | |
| // 1. User messages can contain both text and images (as inlineData) | |
| // 2. Model messages should only contain text parts | |
| // 3. Images in history are stored as data URLs in our app, but converted to base64 for the API | |