Skip to content

FixJson

Namespace: Vercel.AI.Util

public static class FixJson

Repairs truncated JSON by scanning once and closing open strings, literals, arrays, and objects.

Inheritance: object

View source

public static string Repair(string? input)

Returns <code class=“paramref”>input</code> with truncated JSON closed enough for a standard parser.

Parameters

Name Type Description
input string

Returns: string

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product