Trajectory.fromJson constructor

Trajectory.fromJson(
  1. Object? j
)

Implementation

factory Trajectory.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Trajectory(
    toolCalls: switch (json['toolCalls']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) ToolCall.fromJson(i)],
      _ => throw const FormatException('"toolCalls" is not a list'),
    },
  );
}