Files
intl_news/llm/__init__.py
T
2026-07-18 16:13:52 +08:00

62 lines
1.4 KiB
Python

"""LLM 翻译 + 投资事件抽取模块 (M4)。
公共 API:
- load_llm_config / make_sync_client / make_async_client
- translate_and_extract / translate_and_extract_async
- PromptTemplate / parse_translation_json
- translate_all_deduped(批量管道)
- EnTranslatedArticle / EventExtraction / LLMTranslationOutput / Sentiment
"""
from llm.client import (
LLMConfig,
load_llm_config,
make_async_client,
make_sync_client,
)
from llm.extractor import (
DEFAULT_MAX_ATTEMPTS,
MAX_CONTENT_CHARS,
PromptTemplate,
parse_translation_json,
translate_and_extract,
translate_and_extract_async,
)
from llm.models import (
INTERNATIONAL_EVENT_TYPES,
MAX_IMPORTANCE,
MIN_IMPORTANCE,
EnTranslatedArticle,
EventExtraction,
LLMCallError,
LLMTranslationOutput,
Sentiment,
)
from llm.pipeline import translate_all_deduped
__all__ = [
# 客户端
"LLMConfig",
"load_llm_config",
"make_async_client",
"make_sync_client",
# 翻译+抽取
"DEFAULT_MAX_ATTEMPTS",
"MAX_CONTENT_CHARS",
"PromptTemplate",
"parse_translation_json",
"translate_and_extract",
"translate_and_extract_async",
# 批量管道
"translate_all_deduped",
# 模型
"EnTranslatedArticle",
"EventExtraction",
"INTERNATIONAL_EVENT_TYPES",
"LLMCallError",
"LLMTranslationOutput",
"MAX_IMPORTANCE",
"MIN_IMPORTANCE",
"Sentiment",
]