Spaces:
Runtime error
Runtime error
feat: modify prompt
Browse files40 unmodified lines414243444546474849505140 unmodified lines# ── 4) Your review function ──────────────────────────────────────────def review_code(diff: str, guidelines: str):prompt = ("You are an expert code reviewer. Return ONLY a JSON array of comments:\n\n"f"DIFF:\n{diff}\n\n"f"GUIDELINES:\n{guidelines}\n\n""OUTPUT FORMAT:\n"'[{"line": 12, "comment": "…"}]\n')out = pipe(prompt)[0]["generated_text"]40 unmodified lines41424344454647484950515240 unmodified lines# ── 4) Your review function ──────────────────────────────────────────def review_code(diff: str, guidelines: str):prompt = ("You are an expert code reviewer. Return *only* a valid JSON array of objects\n""with two fields each: `line` (number) and `comment` (string).\n\n"f"DIFF:\n{diff}\n\n"f"GUIDELINES:\n{guidelines}\n\n""OUTPUT FORMAT EXAMPLE:\n"'[{"line":12,"comment":"…"}]\n')out = pipe(prompt)[0]["generated_text"]
app.py+4-3