mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-02 16:43:16 +00:00
feat: add error normalization middleware for tool and model calls []Closes #904]
This commit is contained in:
parent
7413befa79
commit
03744fbf2d
2 changed files with 2 additions and 4 deletions
|
|
@ -45,9 +45,7 @@ def _extract_tool_name(request: ToolCallRequest | None) -> str | None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def _to_error_payload(
|
def _to_error_payload(e: Exception, request: ToolCallRequest | None = None) -> dict[str, str]:
|
||||||
e: Exception, request: ToolCallRequest | None = None
|
|
||||||
) -> dict[str, str]:
|
|
||||||
data: dict[str, str] = {
|
data: dict[str, str] = {
|
||||||
"error": str(e),
|
"error": str(e),
|
||||||
"error_type": e.__class__.__name__,
|
"error_type": e.__class__.__name__,
|
||||||
|
|
|
||||||
|
|
@ -91,4 +91,4 @@ def commit_and_open_pr(
|
||||||
"title": title,
|
"title": title,
|
||||||
"body": body,
|
"body": body,
|
||||||
"commit_message": commit_message or title,
|
"commit_message": commit_message or title,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue