Skip to content

Commit 7041ab3

Browse files
Merge pull request #472 from DefangLabs/eric/remove-gateway-anchor
unanchor the gateway used
2 parents 2295623 + 1c4704a commit 7041ab3

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-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+
def health_check():
163+
"""Health check endpoint"""
164+
return "ok"
165+
166+
161167
# Start Flask server when this script is run directly
162168
if __name__ == '__main__':
163169

samples/agentic-strands/compose.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,25 @@ services:
1313
LLM_URL: http://llm/api/v1/
1414
LLM_MODEL: default
1515
OPENAI_API_KEY: FAKE_TOKEN
16+
healthcheck:
17+
test:
18+
[
19+
"CMD",
20+
"python3",
21+
"-c",
22+
"import urllib.request; exit(0) if urllib.request.urlopen('http://localhost:5001/health').status == 200 else exit(1)",
23+
]
24+
interval: 30s
25+
timeout: 5s
26+
retries: 3
27+
start_period: 10s
1628
depends_on:
1729
- llm
1830

1931
llm:
2032
environment:
2133
- OPENAI_API_KEY=FAKE_TOKEN
22-
image: defangio/openai-access-gateway:06339c7
34+
image: defangio/openai-access-gateway
2335
ports:
2436
- target: 80
2537
published: 80

0 commit comments

Comments
 (0)