GroundingChunk_RetrievedContext.fromJson constructor

GroundingChunk_RetrievedContext.fromJson(
  1. Object? j
)

Implementation

factory GroundingChunk_RetrievedContext.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return GroundingChunk_RetrievedContext(
    ragChunk: switch (json['ragChunk']) {
      null => null,
      Object $1 => RagChunk.fromJson($1),
    },
    uri: switch (json['uri']) {
      null => null,
      Object $1 => decodeString($1),
    },
    title: switch (json['title']) {
      null => null,
      Object $1 => decodeString($1),
    },
    text: switch (json['text']) {
      null => null,
      Object $1 => decodeString($1),
    },
    documentName: switch (json['documentName']) {
      null => null,
      Object $1 => decodeString($1),
    },
  );
}