EvaluationInstance_DeprecatedAgentConfig.fromJson constructor

EvaluationInstance_DeprecatedAgentConfig.fromJson(
  1. Object? j
)

Implementation

factory EvaluationInstance_DeprecatedAgentConfig.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return EvaluationInstance_DeprecatedAgentConfig(
    toolsText: switch (json['toolsText']) {
      null => null,
      Object $1 => decodeString($1),
    },
    tools: switch (json['tools']) {
      null => null,
      Object $1 => EvaluationInstance_DeprecatedAgentConfig_Tools.fromJson(
        $1,
      ),
    },
    agentId: switch (json['agentId']) {
      null => '',
      Object $1 => decodeString($1),
    },
    agentType: switch (json['agentType']) {
      null => '',
      Object $1 => decodeString($1),
    },
    description: switch (json['description']) {
      null => '',
      Object $1 => decodeString($1),
    },
    subAgents: switch (json['subAgents']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"subAgents" is not a list'),
    },
    developerInstruction: switch (json['developerInstruction']) {
      null => null,
      Object $1 => EvaluationInstance_InstanceData.fromJson($1),
    },
  );
}