Add JSON serialization to LLM message types
Message, Part (Text/Image/File), ToolCall, FunctionCall, and Usage now round-trip through JSON. Message uses a type-discriminated envelope for the Part interface. Required for checkpoint persistence. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
@@ -20,17 +20,17 @@ type (
|
||||
}
|
||||
|
||||
TextPart struct {
|
||||
Text string
|
||||
Text string `json:"text"`
|
||||
}
|
||||
|
||||
ImagePart struct {
|
||||
URL string
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
FilePart struct {
|
||||
Data string // base64-encoded content
|
||||
MimeType string // e.g. "application/pdf", "text/csv", "image/png"
|
||||
Filename string
|
||||
Data string `json:"data"` // base64-encoded content
|
||||
MimeType string `json:"mime_type"` // e.g. "application/pdf", "text/csv", "image/png"
|
||||
Filename string `json:"filename"`
|
||||
}
|
||||
|
||||
ThinkingPart struct {
|
||||
|
||||
Reference in New Issue
Block a user