mirror of
https://github.com/dzhng/deep-research.git
synced 2026-03-22 07:57:16 +08:00
outputs to seperate file
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,5 +1,8 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# Output files
|
||||
output.md
|
||||
|
||||
# Dependencies
|
||||
node_modules
|
||||
.pnp
|
||||
|
||||
@@ -118,7 +118,7 @@ The system will then:
|
||||
3. Recursively explore deeper based on findings
|
||||
4. Generate a comprehensive markdown report
|
||||
|
||||
The final report will be saved as `report.md` in your working directory.
|
||||
The final report will be saved as `output.md` in your working directory.
|
||||
|
||||
## How It Works
|
||||
|
||||
|
||||
20
src/run.ts
20
src/run.ts
@@ -25,17 +25,9 @@ async function run() {
|
||||
|
||||
// Get breath and depth parameters
|
||||
const breadth =
|
||||
parseInt(
|
||||
await askQuestion(
|
||||
'Enter research breadth (recommended 2-10, default 4): ',
|
||||
),
|
||||
10,
|
||||
) || 4;
|
||||
parseInt(await askQuestion('Enter research breadth (recommended 2-10, default 4): '), 10) || 4;
|
||||
const depth =
|
||||
parseInt(
|
||||
await askQuestion('Enter research depth (recommended 1-5, default 2): '),
|
||||
10,
|
||||
) || 2;
|
||||
parseInt(await askQuestion('Enter research depth (recommended 1-5, default 2): '), 10) || 2;
|
||||
|
||||
console.log(`Creating research plan...`);
|
||||
|
||||
@@ -71,9 +63,7 @@ ${followUpQuestions.map((q, i) => `Q: ${q}\nA: ${answers[i]}`).join('\n')}
|
||||
});
|
||||
|
||||
console.log(`\n\nLearnings:\n\n${learnings.join('\n')}`);
|
||||
console.log(
|
||||
`\n\nVisited URLs (${visitedUrls.length}):\n\n${visitedUrls.join('\n')}`,
|
||||
);
|
||||
console.log(`\n\nVisited URLs (${visitedUrls.length}):\n\n${visitedUrls.join('\n')}`);
|
||||
console.log('Writing final report...');
|
||||
|
||||
const report = await writeFinalReport({
|
||||
@@ -83,10 +73,10 @@ ${followUpQuestions.map((q, i) => `Q: ${q}\nA: ${answers[i]}`).join('\n')}
|
||||
});
|
||||
|
||||
// Save report to file
|
||||
await fs.writeFile('report.md', report, 'utf-8');
|
||||
await fs.writeFile('output.md', report, 'utf-8');
|
||||
|
||||
console.log(`\n\nFinal Report:\n\n${report}`);
|
||||
console.log('\nReport has been saved to report.md');
|
||||
console.log('\nReport has been saved to output.md');
|
||||
rl.close();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user