Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1216

String in utf8 format, i need to make it normal text

$
0
0

I have llama model on deepinfra, and its resposes me utf8 string in answer, idk how to parse it into normal format.im trying

Future<String> getContent(String style, String size, String keywords,      String additional, String content) async {    final Constants env = Constants();    String promtString =        $style;    String requestBody = jsonEncode({"model": "meta-llama/Meta-Llama-3-70B-Instruct","messages": [        {"role": "user", "content": promtString}      ]    });    var url = Uri.https(env.llamaApiUrl, env.llamaApiVersion);    var response = await http.post(url, body: requestBody, headers: {"Authorization": env.llamaApiKey,"Content-Type": "application/json"    });    var result = jsonDecode(response.body);    print(utf8.decode(result["choices"][0]["message"]["content"]));    return result["choices"][0]["message"]["content"];  }

I expecting, that i need to change format of string, but how?


Viewing all articles
Browse latest Browse all 1216

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>