feat: 支持独立图片模型和按日期重生成日报
This commit is contained in:
@ -223,8 +223,20 @@ def cmd_summarize(args):
|
||||
)
|
||||
# The EFundGPT preflight must pass before history sync or storage access.
|
||||
client.assert_model_available()
|
||||
image_client = client
|
||||
image_model = getattr(args, "image_model", None)
|
||||
if image_model and image_model != model:
|
||||
image_client = MagpieClient(
|
||||
model=image_model,
|
||||
base_url=base_url,
|
||||
api_key=os.environ.get("MAGPIE_API_KEY"),
|
||||
timeout=args.timeout,
|
||||
)
|
||||
image_client.assert_model_available()
|
||||
if args.check:
|
||||
print(f"OK Magpie 可用模型: {model}(未读取消息)")
|
||||
if image_client is not client:
|
||||
print(f"OK Magpie 可用图片模型: {image_model}")
|
||||
return 0
|
||||
config = load_config(getattr(args, "config", None))
|
||||
output_config = {} if args.output else config["output"]
|
||||
@ -318,7 +330,7 @@ def cmd_summarize(args):
|
||||
from snooper_card_images import enrich_card_images
|
||||
|
||||
image_stats = enrich_card_images(
|
||||
LarkClient(LarkAuth()), client, rows, max_images=3
|
||||
LarkClient(LarkAuth()), image_client, rows, max_images=3
|
||||
)
|
||||
if image_stats["candidates"]:
|
||||
print(
|
||||
@ -330,7 +342,7 @@ def cmd_summarize(args):
|
||||
|
||||
video_stats = enrich_videos(
|
||||
LarkClient(LarkAuth()),
|
||||
client,
|
||||
image_client,
|
||||
rows,
|
||||
max_frames=getattr(args, "video_frames", 12),
|
||||
transcribe_audio=not getattr(args, "no_video_audio", False),
|
||||
@ -574,6 +586,7 @@ def main():
|
||||
summarize.add_argument("--timezone", default="Asia/Shanghai", help="统计日边界时区")
|
||||
summarize.add_argument("--chat", action="append", help="只汇总指定 chat_id;可重复")
|
||||
summarize.add_argument("--model", help="实际模型段必须以 EFundGPT 开头;也可设 MAGPIE_MODEL")
|
||||
summarize.add_argument("--image-model", help="图片卡片和视频帧使用的 EFundGPT 模型;默认同主模型")
|
||||
summarize.add_argument("--base-url", help="Magpie OpenAI 兼容地址")
|
||||
summarize.add_argument("--timeout", type=int, default=180, help="单次 Magpie 请求超时秒数")
|
||||
summarize.add_argument("--max-chars", type=int, default=80000, help="每个对话内每块消息最大字符数")
|
||||
|
||||
Reference in New Issue
Block a user