Skip to content

Commit c2912a5

Browse files
committed
add health check
1 parent 56c59df commit c2912a5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

samples/agentic-strands/app/agent.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ def chat():
158158
print(f"Error in /chat endpoint: {str(e)}")
159159
return jsonify({"error": str(e), "response": str(e)}), 500
160160

161+
@app.get("/health")
162+
async def health_check():
163+
"""Health check endpoint"""
164+
return {"status": "healthy", "message": "AI Library Assistant is running"}
165+
166+
161167
# Start Flask server when this script is run directly
162168
if __name__ == '__main__':
163169

samples/agentic-strands/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ services:
1919
"CMD",
2020
"python3",
2121
"-c",
22-
"import urllib.request; exit(0) if urllib.request.urlopen('http://localhost:5001/').status == 200 else exit(1)",
22+
"import urllib.request; exit(0) if urllib.request.urlopen('http://localhost:5001/health').status == 200 else exit(1)",
2323
]
2424
interval: 30s
2525
timeout: 5s

0 commit comments

Comments
 (0)