fix: OpenAI API 키 수정 및 에러 로깅 개선
- Vault에서 올바른 OpenAI API 키 가져와 워커 시크릿 업데이트 - 에러 응답에 details 필드 추가 (디버깅용) - AI 응답 로깅 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -806,9 +806,11 @@ async function handleRecommend(
|
||||
return jsonResponse(response, 200, corsHeaders);
|
||||
} catch (error) {
|
||||
console.error('[Recommend] Error:', error);
|
||||
console.error('[Recommend] Error stack:', error instanceof Error ? error.stack : 'No stack');
|
||||
return jsonResponse(
|
||||
{
|
||||
error: 'Failed to generate recommendations',
|
||||
details: error instanceof Error ? error.message : 'Unknown error',
|
||||
request_id: requestId,
|
||||
},
|
||||
500,
|
||||
@@ -1634,9 +1636,11 @@ The option with the LOWEST TOTAL MONTHLY COST (including bandwidth) should have
|
||||
const response = openaiResult.choices[0]?.message?.content || '';
|
||||
|
||||
console.log('[AI] Response received from OpenAI, length:', response.length);
|
||||
console.log('[AI] Raw response preview:', response.substring(0, 500));
|
||||
|
||||
// Parse AI response
|
||||
const aiResult = parseAIResponse(response);
|
||||
console.log('[AI] Parsed recommendations count:', aiResult.recommendations.length);
|
||||
|
||||
// Pre-index VPS benchmarks by provider for O(1) lookups
|
||||
const vpsByProvider = new Map<string, VPSBenchmark[]>();
|
||||
|
||||
Reference in New Issue
Block a user