Obsidian中Text-Generate接入智谱清言报错JSON-parse-error
Obsidian中Text Generate接入智谱清言报错:JSON parse error
一、问题描述
双击空格,触发自动建议时报错:error:{message:“JSON parse error: Cannot construct instance of
java.util.ArrayList
(although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value (‘.’); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of
java.util.ArrayList
(although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value (‘.’)\n at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 142] (through reference chain: com.wd.paas.api.domain.v4.chat.ChatCompletionRequest[“stop”])”,code:‘400’}}
二、原因及解决方案
1、原因:ctrl + shift + i 打开控制台后,再次双击空格触发自动建议时,查看上传的参数,stop中含有报错提示中所说的 英文句号,
2、参考智谱清言API开发文档, ,glm-4-flash模型免费;其中请求参数stop为list形式,而上送的为字符串形式,所以导致了解析错误;
3、解决方案:选择设置,将Advance mode 打开,自定义上送参数,将上送body体中的stop改为[“{ {stop}}”]形式,关闭设置,重新双击空格即可;