refactor: improve logging details and context

This commit is contained in:
Han Xiao 2025-06-10 13:46:51 -07:00
parent a179807c5a
commit 4810393923
2 changed files with 3 additions and 3 deletions

View File

@ -563,8 +563,7 @@ export async function getResponse(question?: string,
} as StepAction;
// print allowed and chose action
const actionsStr = [allowSearch, allowRead, allowAnswer, allowReflect, allowCoding].map((a, i) => a ? ['search', 'read', 'answer', 'reflect'][i] : null).filter(a => a).join(', ');
logDebug(`${currentQuestion}: ${thisStep.action} <- [${actionsStr}]`);
logDebug('Step details:', thisStep);
logDebug(`Step decision: ${thisStep.action} <- [${actionsStr}]`, { thisStep, currentQuestion });
context.actionTracker.trackAction({ totalStep, thisStep, gaps });

View File

@ -3,7 +3,7 @@ import { getKnowledgeStr } from "../utils/text-tools";
import { getModel } from "../config";
import { generateText } from "ai";
import { Schemas } from "../utils/schemas";
import { logInfo, logError, logDebug, logWarning } from '../logging';
import { logInfo, logError, logDebug } from '../logging';
function getPrompt(mdContent: string, allKnowledge: KnowledgeItem[], schema: Schemas): PromptPair {
@ -22,6 +22,7 @@ Your task is to revise the provided markdown content (written by your junior int
- Write section headers as single phrases without colons (##, ###) to organize long content. Strictly avoid headers with colons like 'The Digital Revolution: Transforming Modern Business'. Instead use 'Digital Transformation in Business'.
- Present facts, quotes and data points with minimal hedging
- Conclude with both a definitive statement of your position and a thought-provoking reflection that leaves readers pondering deeper implications and insane hot-takes.
- Remove all disclaimer and copyright notices at the end of the content.
</structure>