INNER CODE UNIT · Python

error

VersusControl/devops-ai-guidelines · 03-ai-agent-for-devops/code/10/app.py:82

    def error(self, msg: str):
        self.status.update(label="Error", state="error")
        self.status.write(f"Error: {msg}")


def _summarize_result(tool_name: str, result: str) -> str:
    """One-line preview of a tool result for the progress panel."""
    r = str(result)
    if tool_name == "list_log_files":
        count = r.count(".log")
        return f"found {count} log file{'s' if count != 1 else ''}"
    if tool_name == "read_log_file":
        return "file read"
    if tool_name == "search_logs":
        first_line = r.split("\n")[0]
        return first_line.lower() if "Found" in first_line else "search complete"
    if tool_name == "send_slack_notification":
        return "notification sent"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…