[agent] LLM-based editing (#3985)

Co-authored-by: Tim O'Farrell <tofarr@gmail.com>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
Co-authored-by: Robert Brennan <accounts@rbren.io>
Co-authored-by: Graham Neubig <neubig@gmail.com>
This commit is contained in:
Xingyao Wang
2024-10-21 15:51:44 -05:00
committed by GitHub
parent 6fe5482b20
commit da548d308c
46 changed files with 1749 additions and 1706 deletions

View File

@@ -3,6 +3,16 @@ from abc import ABC, abstractmethod
from openhands.events.action import Action
class ActionParseError(Exception):
"""Exception raised when the response from the LLM cannot be parsed into an action."""
def __init__(self, error: str):
self.error = error
def __str__(self):
return self.error
class ResponseParser(ABC):
"""This abstract base class is a general interface for an response parser dedicated to
parsing the action from the response from the LLM.