buildRequestPayload method

Map<String, dynamic> buildRequestPayload(
  1. String question,
  2. double temperature
)

Build the JSON payload sent to the AI endpoint.

Implementation

Map<String, dynamic> buildRequestPayload(
  String question,
  double temperature,
) {
  return {
    'prompt': {
      'messages': [
        {'author': 'system', 'content': systemPrompt},
        {'author': 'user', 'content': question},
      ],
    },
    'temperature': temperature,
    'maxOutputTokens': 800,
  };
}