buildRequestData method
Builds the Chat Completions payload.
Luna defaults to a non-none reasoning effort when the field is omitted, but Chat Completions only accepts function tools when that effort is explicitly disabled.
Implementation
Map<String, dynamic> buildRequestData(String prompt) {
final hasTools = tools?.isNotEmpty == true;
return {
"model": model,
"tools": tools,
"messages": _getMessages(prompt),
if (hasTools)
"reasoning_effort": "none"
else if (reasoningEffort != null)
"reasoning_effort": reasoningEffort,
};
}