# substitute_string

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/plugins/substitution/substitute_string)

Substitute plugin path variables in a string.

## Signature

```python
substitute_string(
    value: str,
    *,
    plugin_root: Path,
    plugin_data: Path,
    project_dir: Path | None = None,
) -> str
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `value` | `str` | Yes | String to transform. |
| `plugin_root` | `Path` | Yes | Plugin root directory. |
| `plugin_data` | `Path` | Yes | Plugin data directory. |
| `project_dir` | `Path \| None` | No | Optional project directory. (default: `None`) |

## Returns

`str`

String with supported plugin variables substituted.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/caaa7e7c12d214afa5cf0a1afed8eb6232aa6f7b/libs/code/deepagents_code/plugins/substitution.py#L39)