mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 09:56:36 +01:00
fix(llm): resolve tool lint errors
This commit is contained in:
@@ -60,7 +60,7 @@ export class SmartRetryTool implements ToolHandler {
|
|||||||
*/
|
*/
|
||||||
private generateBroaderTerms(query: string): string[] {
|
private generateBroaderTerms(query: string): string[] {
|
||||||
const terms = query.toLowerCase().split(/\s+/);
|
const terms = query.toLowerCase().split(/\s+/);
|
||||||
const broader = [];
|
const broader: string[] = [];
|
||||||
|
|
||||||
// Single words from multi-word queries
|
// Single words from multi-word queries
|
||||||
if (terms.length > 1) {
|
if (terms.length > 1) {
|
||||||
@@ -103,7 +103,7 @@ export class SmartRetryTool implements ToolHandler {
|
|||||||
'report': ['summary', 'document', 'findings', 'results']
|
'report': ['summary', 'document', 'findings', 'results']
|
||||||
};
|
};
|
||||||
|
|
||||||
const synonyms = [];
|
const synonyms: string[] = [];
|
||||||
const queryLower = query.toLowerCase();
|
const queryLower = query.toLowerCase();
|
||||||
|
|
||||||
for (const [word, syns] of Object.entries(synonymMap)) {
|
for (const [word, syns] of Object.entries(synonymMap)) {
|
||||||
@@ -131,7 +131,7 @@ export class SmartRetryTool implements ToolHandler {
|
|||||||
'notes': ['meeting notes', 'research notes', 'project notes']
|
'notes': ['meeting notes', 'research notes', 'project notes']
|
||||||
};
|
};
|
||||||
|
|
||||||
const narrower = [];
|
const narrower: string[] = [];
|
||||||
const queryLower = query.toLowerCase();
|
const queryLower = query.toLowerCase();
|
||||||
|
|
||||||
for (const [broad, narrowTerms] of Object.entries(narrowerMap)) {
|
for (const [broad, narrowTerms] of Object.entries(narrowerMap)) {
|
||||||
@@ -155,7 +155,7 @@ export class SmartRetryTool implements ToolHandler {
|
|||||||
'meeting': ['agenda', 'minutes', 'action items', 'participants']
|
'meeting': ['agenda', 'minutes', 'action items', 'participants']
|
||||||
};
|
};
|
||||||
|
|
||||||
const related = [];
|
const related: string[] = [];
|
||||||
const queryLower = query.toLowerCase();
|
const queryLower = query.toLowerCase();
|
||||||
|
|
||||||
for (const [concept, relatedTerms] of Object.entries(relatedMap)) {
|
for (const [concept, relatedTerms] of Object.entries(relatedMap)) {
|
||||||
@@ -237,7 +237,14 @@ export class SmartRetryTool implements ToolHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Try each alternative
|
// Try each alternative
|
||||||
const results = [];
|
const results: Array<{
|
||||||
|
query: string;
|
||||||
|
success: boolean;
|
||||||
|
count?: number;
|
||||||
|
result?: any;
|
||||||
|
message?: string;
|
||||||
|
error?: string;
|
||||||
|
}> = [];
|
||||||
let successfulSearches = 0;
|
let successfulSearches = 0;
|
||||||
let totalResults = 0;
|
let totalResults = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,12 @@ export interface ToolParameter {
|
|||||||
type: string;
|
type: string;
|
||||||
description: string;
|
description: string;
|
||||||
enum?: string[];
|
enum?: string[];
|
||||||
|
default?: any;
|
||||||
|
minimum?: number;
|
||||||
|
maximum?: number;
|
||||||
|
minItems?: number;
|
||||||
|
maxItems?: number;
|
||||||
|
properties?: Record<string, ToolParameter>;
|
||||||
items?: ToolParameter | {
|
items?: ToolParameter | {
|
||||||
type: string;
|
type: string;
|
||||||
properties?: Record<string, ToolParameter>;
|
properties?: Record<string, ToolParameter>;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export const unifiedSearchToolDefinition: Tool = {
|
|||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
description: 'Optional filters',
|
description: 'Optional filters for search',
|
||||||
properties: {
|
properties: {
|
||||||
parentNoteId: {
|
parentNoteId: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
|||||||
Reference in New Issue
Block a user