mirror of
https://github.com/EthanMarti/infio-copilot.git
synced 2026-05-13 19:11:02 +00:00
add local embed
This commit is contained in:
@@ -112,5 +112,5 @@ export function getRulesSection(
|
||||
if (mode === 'learn') {
|
||||
return getLearnModeRulesSection(cwd, searchTool);
|
||||
}
|
||||
return getObsidianRulesSection(mode, cwd, searchTool, supportsComputerUse, diffStrategy, experiments);
|
||||
return getObsidianRulesSection(mode, cwd, searchTool);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,5 @@ By waiting for and carefully considering the user's response after each tool use
|
||||
}
|
||||
|
||||
export function getToolUseGuidelinesSection(mode?: string): string {
|
||||
if (mode === 'learn') {
|
||||
return getLearnModeToolUseGuidelines();
|
||||
}
|
||||
return getDefaultToolUseGuidelines();
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ export type ToolName = keyof typeof TOOL_DISPLAY_NAMES
|
||||
|
||||
// Tool helper functions
|
||||
export function getToolName(toolConfig: string | readonly [ToolName, ...unknown[]]): ToolName {
|
||||
return typeof toolConfig === "string" ? toolConfig : toolConfig[0]
|
||||
return typeof toolConfig === "string" ? toolConfig as ToolName : toolConfig[0]
|
||||
}
|
||||
|
||||
export function getToolOptions(toolConfig: string | readonly [ToolName, ...unknown[]]): unknown {
|
||||
|
||||
@@ -981,8 +981,9 @@ export class TransEngine {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case TransformationType.CONCISE_DENSE_SUMMARY:
|
||||
case TransformationType.DENSE_SUMMARY:
|
||||
// 新的摘要类型不需要特殊的后处理,保持原样
|
||||
break;
|
||||
case TransformationType.HIERARCHICAL_SUMMARY:
|
||||
// 新的摘要类型不需要特殊的后处理,保持原样
|
||||
break;
|
||||
@@ -1237,7 +1238,7 @@ export class TransEngine {
|
||||
const cacheResult = await this.checkDatabaseCache(
|
||||
fileMetadata.sourcePath,
|
||||
fileMetadata.sourceMtime,
|
||||
TransformationType.CONCISE_DENSE_SUMMARY
|
||||
TransformationType.DENSE_SUMMARY
|
||||
)
|
||||
|
||||
if (cacheResult.foundCache && cacheResult.result.success && cacheResult.result.result) {
|
||||
@@ -1273,7 +1274,7 @@ export class TransEngine {
|
||||
// 保存到数据库
|
||||
await this.saveResultToDatabase(
|
||||
summary,
|
||||
TransformationType.CONCISE_DENSE_SUMMARY,
|
||||
TransformationType.DENSE_SUMMARY,
|
||||
fileMetadata.sourcePath,
|
||||
fileMetadata.sourceMtime,
|
||||
'document'
|
||||
@@ -1295,7 +1296,7 @@ export class TransEngine {
|
||||
const messages: RequestMessage[] = [
|
||||
{
|
||||
role: 'system',
|
||||
content: CONCISE_DENSE_SUMMARY_PROMPT
|
||||
content: DENSE_SUMMARY_PROMPT
|
||||
},
|
||||
{
|
||||
role: 'user',
|
||||
@@ -1308,7 +1309,7 @@ export class TransEngine {
|
||||
throw new Error(`生成摘要失败: ${result.error.message}`)
|
||||
}
|
||||
|
||||
return this.postProcessResult(result.value, TransformationType.CONCISE_DENSE_SUMMARY)
|
||||
return this.postProcessResult(result.value, TransformationType.DENSE_SUMMARY)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user