test_timeout_real.cjs 1.1 KB

12345678910111213141516171819202122232425262728
  1. const { callLLMWithMessages } = require('/data/ai/audio/server/dist/services/llm/index');
  2. const messages = [
  3. { role: 'system', content: 'You are a test.' },
  4. { role: 'user', content: 'Reply: HA_REAL_OK' },
  5. ];
  6. // minimax 的真实 modelId(从配置里看)
  7. const targetModel = 'MiniMax-M2.7';
  8. console.log('TARGET:', targetModel, '| 应该立即 ECONNREFUSED 切到下家');
  9. console.log('---TEST START---');
  10. const t0 = Date.now();
  11. (async () => {
  12. try {
  13. const r = await callLLMWithMessages(messages, targetModel, 30);
  14. console.log('UNEXPECTED_OK:', r.substring(0, 80));
  15. } catch (e) {
  16. console.log('ERROR_NAME:', e.name);
  17. console.log('ERROR_MSG:', (e.message || '').substring(0, 500));
  18. if (e.attempts) {
  19. console.log('PROVIDERS_TRIED:', e.attempts.length);
  20. for (const a of e.attempts) {
  21. console.log(' >>', a.provider + '/' + a.model, '|', a.errorType, '|', a.attempts, '次 |', (a.error || '').substring(0, 100));
  22. }
  23. } else {
  24. console.log('NO_ATTEMPTS');
  25. }
  26. }
  27. console.log('ELAPSED:', Date.now() - t0, 'ms');
  28. })();