feat:优化timing门控逻辑,减少消耗,提高速度
This commit is contained in:
@@ -14,6 +14,7 @@ from . import BaseDataModel
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from src.common.data_models.message_component_data_model import MessageSequence
|
||||
from src.common.data_models.llm_service_data_models import PromptMessage
|
||||
from src.llm_models.payload_content.tool_option import ToolCall
|
||||
|
||||
|
||||
@@ -121,6 +122,10 @@ class ReplyGenerationResult(BaseDataModel):
|
||||
default=None,
|
||||
metadata={"description": "供监控层直接消费的通用 tool 展示详情。"},
|
||||
)
|
||||
request_messages: List["PromptMessage"] = field(
|
||||
default_factory=list,
|
||||
metadata={"description": "本次 replyer 实际发送给模型的消息列表。"},
|
||||
)
|
||||
|
||||
|
||||
def build_reply_monitor_detail(result: ReplyGenerationResult) -> Dict[str, Any]:
|
||||
@@ -133,6 +138,8 @@ def build_reply_monitor_detail(result: ReplyGenerationResult) -> Dict[str, Any]:
|
||||
|
||||
if prompt_text:
|
||||
detail["prompt_text"] = prompt_text
|
||||
if result.request_messages:
|
||||
detail["request_messages"] = result.request_messages
|
||||
if reasoning_text:
|
||||
detail["reasoning_text"] = reasoning_text
|
||||
if output_text:
|
||||
|
||||
Reference in New Issue
Block a user