🐛 Bug fixes on AI Insight
This commit is contained in:
parent
a97c3bce3a
commit
74882116e3
@ -1383,8 +1383,14 @@ class _PostGetInsightPopupState extends State<_PostGetInsightPopup> {
|
|||||||
receiveTimeout: const Duration(minutes: 10),
|
receiveTimeout: const Duration(minutes: 10),
|
||||||
));
|
));
|
||||||
final out = resp.data['response'] as String;
|
final out = resp.data['response'] as String;
|
||||||
|
|
||||||
|
try {
|
||||||
final document = XmlDocument.parse(out);
|
final document = XmlDocument.parse(out);
|
||||||
_thinkingProcess = document.getElement('think')?.innerText.trim();
|
_thinkingProcess = document.getElement('think')?.innerText.trim();
|
||||||
|
} catch (_) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
|
||||||
RegExp cleanThinkingRegExp = RegExp(r'<think>[\s\S]*?</think>');
|
RegExp cleanThinkingRegExp = RegExp(r'<think>[\s\S]*?</think>');
|
||||||
setState(() => _response = out.replaceAll(cleanThinkingRegExp, '').trim());
|
setState(() => _response = out.replaceAll(cleanThinkingRegExp, '').trim());
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user