Tool.fromJson constructor

Tool.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Tool.fromJson(Map<String, dynamic> json) {
  return Tool(
    functionDeclarations:
        decodeListMessage(
          json['functionDeclarations'],
          FunctionDeclaration.fromJson,
        ) ??
        [],
    googleSearchRetrieval: decode(
      json['googleSearchRetrieval'],
      GoogleSearchRetrieval.fromJson,
    ),
    codeExecution: decode(json['codeExecution'], CodeExecution.fromJson),
    googleSearch: decode(json['googleSearch'], Tool_GoogleSearch.fromJson),
    computerUse: decode(json['computerUse'], Tool_ComputerUse.fromJson),
    urlContext: decode(json['urlContext'], UrlContext.fromJson),
  );
}