Ferramentas do agente

edit

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.

category: writeexact matchkeeps the old version
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

pathstringobrigatório

Il dossier.

old_stringstringobrigatório

Exacto, incluso l'espazio.

new_stringstringobrigatório

- Que porre là.

replace_allbooleanfalse

Sostitui ogni ocasiòn in lugar de necessari uno.

Legî prima il file

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

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

Usa multi_edit: un appello, applicat in ordine, tutto o nul. Diversi edit appella a un file costa un turn a cada.