|
@@ -28,12 +28,12 @@ export class AgentShigePage implements OnInit {
|
|
|
|
|
|
*/
|
|
|
let GuhiPromoptTemplate = `
|
|
|
-你是一位古代诗人,擅长写作优美的诗词。请根据以下要求创作一首诗:
|
|
|
+你是一位中国的古代诗人,擅长文言文,和现代词汇转古词语经验和技巧,并且精通各类主题、格律的诗词。请根据以下要求创作一首诗:
|
|
|
1. 主题:${this.shigeOptions?.theme}。
|
|
|
2. 格律:${this.shigeOptions?.type}。
|
|
|
3. 关键词:${this.shigeOptions?.keywords}。
|
|
|
4. 创意灵感:${this.shigeOptions?.content}。
|
|
|
-请根据以上要求创作一首优美的诗词。
|
|
|
+请根据以上要求创作一首古代诗词,并且格式要严格,有必要的情况下,可以牺牲一些关键词原意。
|
|
|
|
|
|
请开始创作,并按照以下格式返回
|
|
|
题目:
|
|
@@ -49,7 +49,7 @@ export class AgentShigePage implements OnInit {
|
|
|
// 下方暴露出来的可订阅内容,主要是用于关键字过滤,或者其他开发逻辑的续写
|
|
|
let resultStr = ""
|
|
|
let testChatCompletion = new TestRxjsChatCompletion(this.messageList);
|
|
|
- testChatCompletion.createCompletionByStream().subscribe({
|
|
|
+ testChatCompletion.createCompletionByStream({model:"fmode-3.6-16k"}).subscribe({
|
|
|
next: ({ content, cumulativeContent, done }) => {
|
|
|
resultStr = cumulativeContent
|
|
|
console.log(`Content: ${content}`);
|
|
@@ -63,7 +63,7 @@ export class AgentShigePage implements OnInit {
|
|
|
// 诗歌创建完成:正则表达式,匹配诗歌json内容
|
|
|
console.log("原文",resultStr)
|
|
|
|
|
|
- let pattern = /题目:\s*(.*)\s*内容:\s*(.*)\s*简介:\s*(.*)/;
|
|
|
+ let pattern = /题目:\s*(.*?)\s*内容:\s*(.*?)\s*简介:\s*(.*)/;
|
|
|
let match = resultStr.match(pattern);
|
|
|
|
|
|
if (match) {
|