Comments 1
JSON экранировать надо.
Вместо
var content = new StringContent(
"{\"model\": \"" + SelectedModel + "\", \"prompt\": \"" + message + "\",\"temperature\": 1,\"max_tokens\": 1000}",
Encoding.UTF8, "application/json");
// ...
var response = await _client.PostAsync("https://api.openai.com/v1/completions", content);
делайте
_client.PostAsJsonAsync("https://api.openai.com/v1/completions", new { model = SelectedModel, prompt = message, temperature = 1, max_tokens = 1000 });
+7
Sign up to leave a comment.
Avalonia и котики и дизайн для разработчика