Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/features/compilation/weeklyAiSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ export async function requestWeeklyAiSummary(
`The AI endpoint is reachable but does not accept this request. Check that VITE_WEEKLY_AI_ENDPOINT points to the Worker /weekly-summary route.${detail ? ` ${detail}` : ''}`,
)
}
if (response.status >= 500) {
throw new Error(`AI endpoint offline or unreachable (${response.status}). Data will be synced shortly after returning online.${detail ? ` ${detail}` : ''}`)
}
throw new Error(`AI endpoint error (${response.status}).${detail ? ` ${detail}` : ''}`)
}

Expand Down
2 changes: 1 addition & 1 deletion worker/src/riskAssessment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type RequestBody = {
}

const GUARD_MODEL = '@cf/meta/llama-guard-3-8b'
const RESPONSE_MODEL = '@cf/meta/llama-3.1-8b-instruct-fp8'
const RESPONSE_MODEL = '@cf/meta/llama-3.3-70b-instruct-fp8-fast'
const SENTIMENT_MODEL = '@cf/huggingface/distilbert-sst-2-int8'
const POSITIVE_ENCOURAGEMENT_THRESHOLD = -0.85
const POSITIVE_EXCE_THRESHOLD = 4
Expand Down
2 changes: 1 addition & 1 deletion worker/src/weeklySummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type RequestBody = {

const HOUR_LIMIT = 24
const DAY_LIMIT = 80
const MODEL = '@cf/meta/llama-3.1-8b-instruct'
const MODEL = '@cf/meta/llama-3.3-70b-instruct-fp8-fast'

export async function handleWeeklySummary(request: Request, env: Env): Promise<Response> {
const origin = request.headers.get('Origin')
Expand Down