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:
@@ -65,8 +65,8 @@ type (
|
||||
FinishReason string
|
||||
|
||||
Usage struct {
|
||||
InputTokens int
|
||||
OutputTokens int
|
||||
InputTokens int `json:"input_tokens"`
|
||||
OutputTokens int `json:"output_tokens"`
|
||||
}
|
||||
|
||||
ChatCompletionResponse struct {
|
||||
|
||||
Reference in New Issue
Block a user