Skip to content

Commit 981a9f9

Browse files
authored
Merge pull request #19 from BrunoV21/process-patch
Process patch
2 parents cd372cf + 18e0e7e commit 981a9f9

4 files changed

Lines changed: 410 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div align="center">
22

33
<!-- [![Docs](https://img.shields.io/badge/docs-CodeTide.github.io-red)](https://brunov21.github.io/CodeTide/) -->
4-
<img src="./codetide/agents/tide/ui/public/codetide-banner.png" alt="code-tide-logo" width="900" height="auto"/>
4+
<img src="https://mclovinittt-agenttidedemo.hf.space/codetide-banner.png" alt="code-tide-logo" width="900" height="auto"/>
55

66

77

@@ -48,7 +48,7 @@ AgentTide consists of a demo, showing how CodeTide can integrate with LLMs and a
4848

4949
<div align="center">
5050
<!-- [![Docs](https://img.shields.io/badge/docs-CodeTide.github.io-red)](https://brunov21.github.io/CodeTide/) -->
51-
<img src="./codetide/agents/tide/ui/public/agent-tide-demo.gif" alt="agent-tide-demo" width="100%" height="auto"/>
51+
<img src="https://mclovinittt-agenttidedemo.hf.space/agent-tide-demo.gif" alt="agent-tide-demo" width="100%" height="auto"/>
5252
</div>
5353

5454
---

codetide/mcp/tools/patch_code/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def text_to_patch(text: str, orig: Dict[str, str]) -> Tuple[Patch, int]:
2525
elif (line.startswith("---") and len(line) == 3) or not line.startswith(("+", "-", " ")):
2626
lines[i] = f" {line}"
2727

28-
elif line.startswith(("+", "-")) and i + 1 < len(lines) and lines[i+1].startswith(" "):
28+
elif line.startswith(("+", "-")) and 1 < i + 1 < len(lines) and lines[i+1].startswith(" ") and not lines[i-1].startswith(("+", "-")) and lines[i+1].strip():
2929
lines[i] = f" {line}"
3030

3131
# Debug output

examples/hf_demo_space/api.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,26 @@ async def logo_dark():
5454
# Return 204 No Content if favicon doesn't exist
5555
return HTMLResponse(status_code=204)
5656

57+
@app.get("/codetide-banner.png", include_in_schema=False)
58+
async def codetide_banner():
59+
"""Serve favicon"""
60+
favicon_path = Path(F"{ROOT_PATH}/public/codetide-banner.png")
61+
if favicon_path.exists():
62+
return FileResponse(favicon_path)
63+
else:
64+
# Return 204 No Content if favicon doesn't exist
65+
return HTMLResponse(status_code=204)
66+
67+
@app.get("/agent-tide-demo.gif", include_in_schema=False)
68+
async def agent_tide_deo_gif():
69+
"""Serve favicon"""
70+
favicon_path = Path(F"{ROOT_PATH}/public/agent-tide-demo.gif")
71+
if favicon_path.exists():
72+
return FileResponse(favicon_path)
73+
else:
74+
# Return 204 No Content if favicon doesn't exist
75+
return HTMLResponse(status_code=204)
76+
5777
mount_chainlit(app=app, target=F"{ROOT_PATH}/app.py", path="/tide")
5878

5979
if __name__ == "__main__":

0 commit comments

Comments
 (0)