25 lines
594 B
Python
25 lines
594 B
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from typing import Any
|
||
|
|
|
||
|
|
|
||
|
|
REASONING_WRAPPER_START = "🤔 推理中..."
|
||
|
|
REASONING_WRAPPER_END = "✅ 推理完成"
|
||
|
|
|
||
|
|
|
||
|
|
def build_reasoning_preview_card(
|
||
|
|
content: str,
|
||
|
|
reasoning_text: str = "",
|
||
|
|
title: str = "AI 助手",
|
||
|
|
) -> dict[str, Any]:
|
||
|
|
from .cards import build_feishu_card
|
||
|
|
|
||
|
|
if not reasoning_text:
|
||
|
|
return build_feishu_card(content, title=title)
|
||
|
|
|
||
|
|
wrapped = f"{REASONING_WRAPPER_START}\n\n{reasoning_text}\n\n{REASONING_WRAPPER_END}\n\n---\n\n{content}"
|
||
|
|
return build_feishu_card(
|
||
|
|
wrapped,
|
||
|
|
title=title,
|
||
|
|
)
|