# 服务层模块
# 包含所有业务逻辑服务，按功能域划分

from .llm_service import (
    call_llm_completion,
    clean_llm_response,
    format_transcription_for_llm,
    process_streaming_with_thinking,
    extract_thinking_content,
    preprocess_long_transcription,
    extract_corrected_text,
    format_api_error_message
)

from .transcription_service import (
    transcribe_audio_asr,
    transcribe_audio_task,
    transcribe_single_file,
    transcribe_with_chunking,
    extract_audio_from_video,
    convert_to_wav
)

from .summary_service import (
    generate_title_task,
    generate_summary_only_task
)

from .embedding_service import (
    get_embedding_model,
    chunk_transcription,
    generate_embeddings,
    serialize_embedding,
    deserialize_embedding,
    process_recording_chunks,
    basic_text_search_chunks,
    semantic_search_chunks
)

from .event_service import (
    extract_events_from_transcript,
    generate_ics_content,
    escape_ical_text
)

from .document_service import (
    add_unicode_paragraph,
    create_docx_with_unicode_title,
    save_and_send_docx,
    process_markdown_to_docx,
    get_recording_display_title,
    sanitize_download_filename_component,
    build_docx_download_filename,
    set_download_filename_header
)

from .speaker_service import (
    update_speaker_usage,
    identify_speakers_from_text,
    identify_unidentified_speakers_from_text
)

from .voiceprint_service import (
    sync_voiceprint_to_platform
)

from .auto_process_service import (
    initialize_file_monitor,
    get_file_monitor_functions
)

from .auth_service import (
    is_safe_url,
    auto_login
)

from .sync_service import (
    start_sync_thread,
    sync_completed_recordings_to_remote
)

# 导入 LLM 客户端配置（供其他模块使用）
from src.clients.llm_client import (
    client,
    TEXT_MODEL_NAME,
    TEXT_MODEL_API_KEY,
    TEXT_MODEL_BASE_URL,
    http_client_no_proxy,
)

__all__ = [
    # LLM 服务 - 大语言模型相关功能
    'call_llm_completion',
    'clean_llm_response',
    'format_transcription_for_llm',
    'process_streaming_with_thinking',
    'extract_thinking_content',
    'preprocess_long_transcription',
    'extract_corrected_text',
    'format_api_error_message',
    
    # 转录服务 - 音频转文字相关功能
    'transcribe_audio_asr',
    'transcribe_audio_task',
    'transcribe_single_file',
    'transcribe_with_chunking',
    'extract_audio_from_video',
    'convert_to_wav',
    
    # 摘要服务 - 标题和摘要生成
    'generate_title_task',
    'generate_summary_only_task',
    
    # 嵌入服务 - 语义搜索和文本分块
    'get_embedding_model',
    'chunk_transcription',
    'generate_embeddings',
    'serialize_embedding',
    'deserialize_embedding',
    'process_recording_chunks',
    'basic_text_search_chunks',
    'semantic_search_chunks',
    
    # 事件服务 - 日历事件提取
    'extract_events_from_transcript',
    'generate_ics_content',
    'escape_ical_text',
    
    # 文档服务 - Word 文档导出
    'add_unicode_paragraph',
    'create_docx_with_unicode_title',
    'save_and_send_docx',
    'process_markdown_to_docx',
    'get_recording_display_title',
    'sanitize_download_filename_component',
    'build_docx_download_filename',
    'set_download_filename_header',
    
    # 说话人服务 - 说话人识别和管理
    'update_speaker_usage',
    'identify_speakers_from_text',
    'identify_unidentified_speakers_from_text',
    
    # 声纹服务 - 声纹同步业务逻辑
    'sync_voiceprint_to_platform',
    
    # 自动处理服务 - 文件监控和自动转写
    'initialize_file_monitor',
    'get_file_monitor_functions',
    
    # 认证服务 - 登录和安全验证
    'is_safe_url',
    'auto_login',
    
    # 远程数据同步服务 - 将完成的录音同步到远程数据库
    'start_sync_thread',
    'sync_completed_recordings_to_remote'
]
