Use json v2

This commit is contained in:
dwrz
2026-10-11 00:55:57 +00:00
parent 81b981c07f
commit 75040646e3
5 changed files with 23 additions and 24 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ package llm
import (
"context"
"encoding/json"
"encoding/json/v2"
"fmt"
"io"
"log/slog"
@@ -74,7 +74,7 @@ func (c *Client) ListModels(ctx context.Context) ([]Model, error) {
}
var body ModelsResponse
if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
if err := json.UnmarshalRead(res.Body, &body); err != nil {
return nil, fmt.Errorf(
"list models: decode response: %w", err,
)