LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Configuration
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsConfigurationTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsbackendsformatGrepResults
Function●Since v1.4

formatGrepResults

Format grep search results based on output mode.

Copy
formatGrepResults(
  results: Record<string, [number, string][]>,
  outputMode: "content" | "files_with_matches" | "count"
): string

Parameters

NameTypeDescription
results*Record<string, [number, string][]>

Dictionary mapping file paths to list of [line_num, line_content] tuples

outputMode*"content" | "files_with_matches" | "count"

Output format - "files_with_matches", "content", or "count"

View source on GitHub