Download main.py from Arvind2006/jenkins-error-explainer: direct link, hf CLI and curl.
- Browser
- Download file 491 Bytes
-
https://huggingface.co/spaces/Arvind2006/jenkins-error-explainer/resolve/main/main.py
- Command line
-
hf download hf://spaces/Arvind2006/jenkins-error-explainer/main.py
-
curl -L -o main.py https://huggingface.co/spaces/Arvind2006/jenkins-error-explainer/resolve/main/main.py
491 Bytes
| from fastapi import FastAPI | |
| from explain_error import explain_error | |
| from langchain_rag import get_rag_chain | |
| app = FastAPI() | |
| def home(): | |
| return {"message": "Jenkins Error Explainer API running"} | |
| def explain(payload: dict): | |
| log = payload["log_text"] | |
| return explain_error(log) | |
| def explain_with_rag(payload: dict): | |
| log = payload["log_text"] | |
| rag_chain = get_rag_chain() | |
| return rag_chain.explain_error(log) | |