Skip to content

Commit b36fa88

Browse files
committed
fix: replace deepseek models with Llama models for better AI analysis
- Map gpt-oss to meta-llama/llama-3.1-405b-instruct:free - Map deepseek models to meta-llama/llama-3.3-70b-instruct:free - Simplify weekly analysis prompts for better model compatibility - Remove debug logging now that analysis is working - Llama models provide detailed, intelligent pet behavior insights
1 parent 9345b2a commit b36fa88

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

src/lib/stores/ruixen.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,13 @@ class Ruixen {
134134
private getBackendModel(frontendModel: string): string {
135135
// Map problematic models to working alternatives
136136
if (frontendModel === 'openai/gpt-oss-120b:free') {
137-
return 'deepseek/deepseek-r1:free';
137+
return 'meta-llama/llama-3.1-405b-instruct:free';
138+
}
139+
if (frontendModel === 'deepseek/deepseek-chat-v3.1:free') {
140+
return 'meta-llama/llama-3.3-70b-instruct:free';
141+
}
142+
if (frontendModel === 'deepseek/deepseek-r1:free') {
143+
return 'meta-llama/llama-3.3-70b-instruct:free';
138144
}
139145
return frontendModel;
140146
}

src/lib/utils/ai-analysis.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,20 @@ export class AIAnalyzer {
9494
.map((e) => `- ${new Date(e.date as any).toLocaleDateString()}: ${e.content}`)
9595
.join('\n') || 'No entries in last 7 days.';
9696

97-
const prompt = `Summarize the last 7 days for ${pet.name} in 4-6 concise bullet points focused on mood, activity, appetite, and any warning signs.
97+
const prompt = `Analyze ${pet.name}'s journal entries from the last 7 days and provide a brief summary.
9898
99-
STRICT RULES:
100-
- Use only the provided entries; do not invent stories, people, or dates.
101-
- No creative writing, titles, emojis, or flourishes.
102-
- Keep language plain and factual.
103-
- Use '-' bullet lines only.
99+
Pet: ${pet.name} (${pet.breed || pet.species || 'pet'}, ${pet.age ?? 'unknown'} years old)
104100
105-
PET: ${pet.name} (${pet.breed || pet.species || 'pet'}, ${pet.age ?? 'unknown'}y)
106-
LAST 7 DAYS:\n${sevenDays}`;
101+
Journal entries:
102+
${sevenDays}
103+
104+
Please provide 3-4 bullet points about:
105+
- Overall mood and behavior
106+
- Activity level changes
107+
- Eating habits
108+
- Any concerns or positive trends
109+
110+
Use simple bullet points starting with '-'`;
107111

108112
const referer = typeof window !== 'undefined' ? window.location.origin : undefined;
109113
const model = modelOverride || this.model;
@@ -119,7 +123,7 @@ LAST 7 DAYS:\n${sevenDays}`;
119123
{
120124
role: 'system',
121125
content:
122-
'You are a veterinary AI assistant. Be concise and factual; never write fiction or narrative prose. Use only provided inputs.',
126+
'You are a helpful pet care assistant. Analyze the provided journal entries and give practical insights about the pet\'s wellbeing.',
123127
},
124128
{ role: 'user', content: prompt },
125129
],

0 commit comments

Comments
 (0)