MCPcopy Create free account
hub / github.com/echoVic/blade-code / getContextForPrompt

Method getContextForPrompt

src/agent/ContextComponent.ts:278–291  ·  view source on GitHub ↗

* 获取上下文为Prompt字符串

(
    filterOptions?: ContextFilter,
    formatOptions?: {
      includeSystemInfo?: boolean;
      includeToolHistory?: boolean;
      includeWorkspaceInfo?: boolean;
      maxRecentMessages?: number;
    }
  )

Source from the content-addressed store, hash-verified

276 * 获取上下文为Prompt字符串
277 */
278 public async getContextForPrompt(
279 filterOptions?: ContextFilter,
280 formatOptions?: {
281 includeSystemInfo?: boolean;
282 includeToolHistory?: boolean;
283 includeWorkspaceInfo?: boolean;
284 maxRecentMessages?: number;
285 }
286 ): Promise<string> {
287 this.ensureReady();
288
289 const { context, compressed } = await this.getFormattedContext(filterOptions);
290 return formatContextForPrompt(context, compressed, formatOptions);
291 }
292
293 /**
294 * 搜索历史会话

Callers

nothing calls this directly

Calls 3

ensureReadyMethod · 0.95
getFormattedContextMethod · 0.95
formatContextForPromptFunction · 0.85

Tested by

no test coverage detected