import { callLLMWithMessages } from './src/services/llm/index.js';

const messages = [
  { role: 'system', content: 'You are a helpful assistant. Return valid JSON only.' },
  { role: 'user', content: '书名：《小星探险》\n一本1000字的小故事书，适合儿童阅读\n\n请生成章级大纲（genLevel=1），返回JSON格式，包含chapters数组。每章有number、title、summary、keyPoints、estimatedWords。' }
];

async function main() {
  try {
    console.log('Starting LLM call...');
    const r = await callLLMWithMessages(messages);
    console.log('Response length:', r.length);
    console.log('Response:\n', r);
  } catch (e: any) {
    console.error('Error:', e.message);
  }
}
main();