StateFileSearchMiddleware(
self,
*,
state_key: str = 'text_editor_files'
)| Name | Type | Description |
|---|---|---|
state_key | str | Default: 'text_editor_files'State key to search Use |
| Name | Type |
|---|---|
| state_key | str |
Provides Glob and Grep search over state-based files.
This middleware adds two tools that search through virtual files in state:
Example:
from langchain.agents import create_agent
from langchain.agents.middleware import (
StateTextEditorToolMiddleware,
StateFileSearchMiddleware,
)
agent = create_agent(
model=model,
tools=[],
middleware=[
StateTextEditorToolMiddleware(),
StateFileSearchMiddleware(),
],
)