call method

Future<String> call(
  1. AgentEngine engine,
  2. AIChatMessageToolCall toolCall
)

Implementation

Future<String> call(
  AgentEngine engine,
  AIChatMessageToolCall toolCall,
) async {
  try {
    return await handleCall(
      engine: engine,
      result: await mapToResult(toolCall.arguments),
    );
  } catch (e) {
    error("Failed to handle tool $name");
    error(e);
    rethrow;
  }
}