import fetch from 'node-fetch';

async function test() {
  const messages = [
    { role: 'user', content: 'Ich will einen Windpark bauen' }
  ];

  console.log('Sending message:', messages[0].content);

  const res = await fetch('http://localhost:3000/api/ai-search', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ messages })
  });

  const data = await res.json();
  console.log('\nAI Response:', data);
}

test().catch(console.error);
