Skip to content

Commit 9b0ba6f

Browse files
committed
fix: correct AI model name to gpt-4o-mini and improve rate limit handling
1 parent b40a9d8 commit 9b0ba6f

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

ai.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const __dirname = dirname(__filename)
66

77
export const aiConfig = {
88
// Model configuration
9-
model: 'gpt-4.1-nano',
9+
model: 'gpt-4o-mini',
1010
temperature: 0.7,
1111
maxTokens: 1500,
1212

src/configs/ai.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const aiConfig = {
22
// Model configuration
3-
model: 'gpt-4.1-nano',
3+
model: 'gpt-4o-mini',
44
temperature: 0.7,
55
maxTokens: 1500,
66

src/echo-ai/aiModel.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ export class AIModel {
8686
return result.text
8787
} catch (error) {
8888
console.error('AI Model Error:', error)
89+
90+
// Check if it's a rate limit error
91+
if (error.message?.includes('Rate limit') || error.statusCode === 429) {
92+
throw new Error('Rate limit exceeded. Please try again in a moment.')
93+
}
94+
8995
throw new Error(`AI model request failed: ${error.message}`)
9096
}
9197
}

0 commit comments

Comments
 (0)