@metreeca/llms
    Preparing search index...
    • Extracts the output text of a Gemini API response as a JSON payload.

      The payload is parsed from the output text produced under the requested response schema, and typed as T without further validation: callers needing guarantees on its shape must validate it themselves.

      Type Parameters

      • T extends Value = Value

        The expected shape of the JSON payload

      Parameters

      • response: GenerateContentResponse

        The response of a generateContent request carrying a response schema

      Returns T

      The JSON payload parsed from the output text of response

      Error If response carries no output text (see text), or if its text is not well-formed JSON, for instance because the reply was cut short by an exhausted output budget