xiongzhu 2 лет назад
Родитель
Сommit
929a4b9136
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/game/game.service.ts

+ 2 - 2
src/game/game.service.ts

@@ -690,7 +690,7 @@ export class GameService implements OnModuleInit {
                     text
                 })
                 const response = await this.callLLM([new HumanMessage(input)])
-                const output = await parser.parse(response.content.replace('+', ''))
+                const output = await parser.parse(response.content.replace('+', '').replace("'", '"'))
                 return output.map((i) => {
                     i.modifyHp = i.modifyHp.filter((j) => charactors.find((k) => k.name === j.name))
                     return i
@@ -803,7 +803,7 @@ export class GameService implements OnModuleInit {
                     new SystemMessage('你是一个富有想象力的写作助手,你的任务是帮我想象一个小说里的角色。'),
                     new HumanMessage(input)
                 ])
-                const output = await parser.parse(response.content)
+                const output = await parser.parse(response.content.replace("'", '"'))
                 return output as Charactor
             } catch (error) {
                 this.logger.error(error)