Use json v2
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user