Skip to content

Commit

Permalink
Fix env variable using way in docker container, update RiskAssessment
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuznik committed Nov 21, 2024
1 parent cd767e5 commit f0860f9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/self-host-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ jobs:
TWILIO_AUTH_TOKEN: ${{secrets.TWILIO_AUTH_TOKEN}}
TWILIO_PHONE_NUMBER: ${{secrets.TWILIO_PHONE_NUMBER}}
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}}
DAY_SMS_LIMIT: 5
run: sudo docker run -d -p 8080:8080 \
--name disaster-alert-container \
--network disaster-net \
-e TWILIO_ACCOUNT_SID=${{secrets.TWILIO_ACCOUNT_SID}} \
-e TWILIO_AUTH_TOKEN=${{secrets.TWILIO_AUTH_TOKEN}} \
-e TWILIO_PHONE_NUMBER=${{secrets.TWILIO_PHONE_NUMBER}} \
-e OPENAI_API_KEY=${{secrets.OPENAI_API_KEY}} \
-e TWILIO_ACCOUNT_SID=$TWILIO_ACCOUNT_SID \
-e TWILIO_AUTH_TOKEN=$TWILIO_AUTH_TOKEN \
-e TWILIO_PHONE_NUMBER=$TWILIO_PHONE_NUMBER \
-e OPENAI_API_KEY=$OPENAI_API_KEY \
-e DAY_SMS_LIMIT=$DAY_SMS_LIMIT \
jkuznik/disaster-alert
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@Slf4j
class RiskAssessmentService {

public static final double RISK_THRESHOLD = 0.7;
public static final double RISK_THRESHOLD = 0.3;
private final OpenAIClient openAIClient;

boolean assessRisk(DisasterAddDTO disasterAddDTO) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spring:

ai:
openai:
api-key: "${{ secrets.OPENAI_API_KEY }}"
api-key: ${OPENAI_API_KEY}
chat:
options:
model: gpt-4o
Expand Down

0 comments on commit f0860f9

Please sign in to comment.