"""
内容生成器测试
"""
import sys
sys.path.insert(0, '.')

from models import OpenAICompatibleProvider
from core import ContentGenerator
from config import settings


def test_coffee_culture():
    """测试咖啡文化内容生成"""
    llm = OpenAICompatibleProvider(
        api_key=settings.API_KEY,
        base_url=settings.API_BASE_URL,
        model=settings.MODEL
    )
    generator = ContentGenerator(llm)

    result = generator.generate(
        content_type="coffee_culture",
        params={
            "topic": "周末咖啡探店",
            "cafe_scenario": "独自工作",
            "mood_keywords": "安静,治愈,专注"
        },
        style="文艺清新"
    )

    print("=== 咖啡文化内容生成 ===")
    print(f"标题: {result['title']}")
    print(f"字数: {result['word_count']}")
    print(f"\n内容:\n{result['content']}")
    print(f"\n标签: {' '.join(result['tags'][:5])}")


if __name__ == "__main__":
    test_coffee_culture()
