Skip to content

Commit e14caf5

Browse files
committed
fix: version endpoint
1 parent d65ba2d commit e14caf5

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/ollama_mcp_bridge/api.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ async def chat(
5454
logger.error(f"/api/chat failed: {e}")
5555
raise HTTPException(status_code=500, detail=f"/api/chat failed: {str(e)}") from e
5656

57+
@app.get("/version", summary="Version information", description="Get version information and check for updates.")
58+
async def version():
59+
"""Version information endpoint."""
60+
latest_version = await check_for_updates(__version__)
61+
62+
return {
63+
"version": __version__,
64+
"latest_version": latest_version
65+
}
5766

5867
@app.api_route("/{path_name:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"],
5968
summary="Transparent proxy", description="Transparent proxy to any Ollama endpoint.",
@@ -76,14 +85,3 @@ async def proxy_to_ollama(
7685
detail=f"Could not connect to Ollama server: {str(e)}") from e
7786
except Exception as e:
7887
raise HTTPException(status_code=500, detail=f"Proxy request failed: {str(e)}") from e
79-
80-
81-
@app.get("/version", summary="Version information", description="Get version information and check for updates.")
82-
async def version():
83-
"""Version information endpoint."""
84-
latest_version = await check_for_updates(__version__)
85-
86-
return {
87-
"version": __version__,
88-
"latest_version": latest_version
89-
}

0 commit comments

Comments
 (0)