Skip to content

Commit

Permalink
Merge pull request #10 from Braffolk/dev
Browse files Browse the repository at this point in the history
0.1.1 - Better prompts with custom hints
  • Loading branch information
Braffolk authored Jan 2, 2025
2 parents 11000c5 + 25b5d82 commit 3d5ff39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mcp-summarization-functions",
"version": "0.1.0",
"version": "0.1.1",
"description": "Provides summarised output from various actions that could otherwise eat up tokens and cause crashes",
"type": "module",
"main": "build/index.js",
Expand Down
11 changes: 10 additions & 1 deletion src/models/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ function getHintInstructions(hint?: string): string {
type_definitions: 'Focus on type structures, relationships, and hierarchies.'
};

if (!hintInstructions[hint]) {
// custom hint instructions
return `Agent provided a hint for analysis: ${hint}. Please focus on this area in your summary.`;
}

return hintInstructions[hint] || '';
}

Expand Down Expand Up @@ -92,11 +97,15 @@ function constructFullInstructions(type: string, options?: SummarizationOptions)
const baseInstructions = getBaseSummarizationInstructions(type);
const hintInstructions = getHintInstructions(options?.hint);
const formatInstructions = getFormatInstructions(options?.output_format);
const finalInstructions = [
"Please do not include any commentary, questions or text other than the relevant summary itself."
];

return [
baseInstructions,
hintInstructions,
formatInstructions
formatInstructions,
...finalInstructions
].filter(Boolean).join('\n\n');
}

Expand Down

0 comments on commit 3d5ff39

Please sign in to comment.