buildRequest method

  1. @override
Map<String, dynamic> buildRequest(
  1. String code
)
override

Implementation

@override
Map<String, dynamic> buildRequest(String code) {
  return {
    "systemInstruction": {
      "parts": [
        {"text": instruction},
      ],
    },
    "contents": [
      {
        "parts": [
          {"text": code},
        ],
      },
    ],
    "generationConfig": {
      "stopSequences": ["Title"],
      "temperature": temperature ?? 1.0,
      "maxOutputTokens": maxOutputTokens ?? 800,
      "topP": topP ?? 0.8,
      "topK": topK ?? 10,
    },
  };
}