Future<String> generateText(String prompt) async {
var messages = [
{"role": "system", "content": "You are a helpful assistant"},
{"role": "user", "content": "주어진 문장을 바탕으로 한글 문법과 맞춤법을 지키는 문장을 알려줘 "},
{"role": "assistant", "content": prompt}
];
final response = await http.post(
Uri.parse(apiUrl),
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer $apiKey'
},
body: jsonEncode({
"model": "gpt-4",
'messages': messages,
'max_tokens': 300, //단어 최대갯수
'temperature': 0.1, //창의성또는 무작위성 낮을수록 더 보수적
}),
);
Map<String, dynamic> newresponse =
jsonDecode(utf8.decode(response.bodyBytes));
return newresponse['choices'][0]['message']['content'];
}
}
3.5turbo은 되는데 4는안됨
참고로 결제는 해놨음
이용료 냈음?
결제함
뭔 결제, 거기 결제 한두개가 아닌데
결제를해라;
결재했음;