feat(llm 對話): 新增 prompt builder 與 few-shot 範例組裝,強化 Claude 對話品質
This commit is contained in:
@@ -63,7 +63,7 @@ export class DialogueService {
|
||||
options: HandleMessageOptions = {},
|
||||
): Promise<HandleMessageResult> {
|
||||
const now = options.now ?? new Date();
|
||||
this.workingMemory.append(sessionId, { role: "user", content: userInput, timestamp: now });
|
||||
await this.workingMemory.append(sessionId, { role: "user", content: userInput, timestamp: now });
|
||||
|
||||
// I-6:按需生成離線事件(今天只生成一次),成為話題來源。
|
||||
await this.offlineEvent.maybeGenerate(characterId, now);
|
||||
@@ -138,7 +138,7 @@ export class DialogueService {
|
||||
this.outputFilter.filter(text, forbiddenWords),
|
||||
context.character.personalityArchetype,
|
||||
);
|
||||
this.workingMemory.append(sessionId, { role: "character", content: filteredText, timestamp: now });
|
||||
await this.workingMemory.append(sessionId, { role: "character", content: filteredText, timestamp: now });
|
||||
|
||||
return { text: filteredText, actions, isFastChannel, availability: effectiveAvailability, exceptionType, context };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user