• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

Did You Know? How AI Agents Write/Edit Code like a developer?

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
Have you ever wondered how the latest software engineering agents can write or edit code so precisely?

These AI-powered tools are transforming the way developers work by automating complex edits with accuracy and speed.

A fantastic example of this capability is the example script from the OpenAI’s Cookbook —

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



This Python utility script applies human-readable patches to text files, showcasing how SE agents can handle code changes like a pro.

Unlike traditional patching tools that depend on line numbers (which can break when code shifts), this script uses context-based patching. It looks at surrounding lines or markers to pinpoint where changes should go, making it ideal for dynamic codebases.

It supports three actions:

  • ADD (insert new code)
  • DELETE (remove code)
  • UPDATE (modify code).

Example in Action
Here’s a real-world snippet where we update a logging call across three files in one go:


*** Begin Patch
*** Update File: logger.py
@@ def log_event(event):
- logger.info(f"Event: {event}")
+ logger.info(f"[EVENT] → {event}")
*** End Patch
The parser spots the UPDATE, finds def greet(): in hello.py, swaps out print(“Hi”) for print(“Hello, World!”), and applies it.

Why This Precision Matters
AI agents using tools like apply_patch.py can:


  1. Automate tedious edits.


  2. Handle large-scale changes reliably.


  3. Adapt to evolving codebases with context-based precision.


  4. It’s a peek into how AI can supercharge development!

Want More?
If you’re interested by how AI agents are changing the landscape like this, like, share, and follow for more cool insights into AI-driven tools!

Source: OpenAI Cookbook —

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.




Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу