truegleai commited on
Commit
e57a8d4
·
1 Parent(s): 724e379

fix: reduce ollama timeout, set route default to ollama

Browse files
Files changed (2) hide show
  1. app/api/ai/chat/route.ts +1 -1
  2. lib/ai-service.ts +1 -1
app/api/ai/chat/route.ts CHANGED
@@ -5,7 +5,7 @@ import { consumeToken } from '@/lib/tokens'
5
  export async function POST(req: NextRequest) {
6
  try {
7
  const body = await req.json()
8
- const { messages, projectCode, provider = 'openrouter' } = body
9
 
10
  // Beta: token always succeeds (unlimited)
11
  const tokenResult = await consumeToken('AI chat message')
 
5
  export async function POST(req: NextRequest) {
6
  try {
7
  const body = await req.json()
8
+ const { messages, projectCode, provider = 'ollama' } = body
9
 
10
  // Beta: token always succeeds (unlimited)
11
  const tokenResult = await consumeToken('AI chat message')
lib/ai-service.ts CHANGED
@@ -97,7 +97,7 @@ class AIService {
97
  }
98
  },
99
  {
100
- timeout: 60000,
101
  headers: {
102
  'Authorization': `Bearer ${process.env.OLLAMA_API_KEY || ''}`,
103
  'Content-Type': 'application/json',
 
97
  }
98
  },
99
  {
100
+ timeout: 10000,
101
  headers: {
102
  'Authorization': `Bearer ${process.env.OLLAMA_API_KEY || ''}`,
103
  'Content-Type': 'application/json',