# edit

Canonical URL: https://developers.iagenify.com/pt/sdk/agent/tools/edit/
Language: pt

`edit({ path, old_string, new_string, replace_all? })`

Reemplace una string exacta in un file. Deve corrispondere esattamente - incluso whitespace - e ser unico a meno che tu dici o contrario.

Status: category: write · exact match · keeps the old version

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `path` | string | obrigatório | Il dossier. |
| `old_string` | string | obrigatório | Exacto, incluso l'espazio. |
| `new_string` | string | obrigatório | - Que porre là. |
| `replace_all` | boolean | false | Sostitui ogni ocasiòn in lugar de necessari uno. |

## Legî prima il file {#read-first}

> **Indentation fa parte del match**
>
> Una strong copied da memoria e non del file differisce generalmente per un spazio o un tabul, e la edit fail. La instruzion da ler prima de edit is in the system prompt per tal motivo — e un edit failed costa un turn.

## Unico, a meno che replace_all {#unique}

Una stringa che aparece due volte è negata: sostituire uno di due passaggi identici è ambiguo, e addivinse che sarebbe peggior di fail. Aggiungere più contesto circondante per render unico, o impostar `replace_all`.

## Diverse edizioni in un file {#several}

Usa [multi_edit](/pt/sdk/agent/tools/multi-edit): un appello, applicat in ordine, tutto o nul. Diversi `edit` appella a un file costa un turn a cada.

- [multi_edit](/pt/sdk/agent/tools/multi-edit): Diversi remplatzings in una volta.
- [leg](/pt/sdk/agent/tools/read): Ce fare prima.
- [Ferramentas do agente](/pt/sdk/agent/tools): The 35, by family.
