google.internal.parse

One decoded response -> canonical content blocks and a stop reason. Gemini sends no call ids; synthesize `call_<seq>_<i>` from the journal position and the call's index within the turn (plus the `thoughtSignature` the call must be replayed with — see `_gm_encode_call_id`).

Reference version

Signature

function google.internal.parse(
seq: int,
provider: string = …
) -> ai.ModelTurn throws baml.json.SerializationError | ai.errors.Failure

One decoded response -> canonical content blocks and a stop reason. Gemini sends no call ids; synthesize call_<seq>_<i> from the journal position and the call's index within the turn (plus the thoughtSignature the call must be replayed with — see _gm_encode_call_id).

A document that carries no turn at all ({} from a broken proxy, an {"error": …} body served with a 200) is a FAILURE, not an empty answer: silently returning an empty Complete turn makes a -> string function return "" as a success. provider names the backend in that failure.

Source:<builtin>/google/ns_internal/gemini.bamlbytes 3105434123