nativeToolCalls function

List<({Map<String, Object?> arguments, String name})> nativeToolCalls(
  1. String rawReply
)

The calls native converted itself: the tool_calls of every JSON object in rawReply (a streamed reply is several, concatenated). A call the model wrote as text stays text, as the native conversation keeps it.

Implementation

List<({String name, Map<String, Object?> arguments})> nativeToolCalls(
  String rawReply,
) => [
  for (final message in concatenatedJsonObjects(rawReply)) ..._callsIn(message),
];