refactor: extract post-ops helpers from pydantic agent

This commit is contained in:
2026-03-01 15:14:57 +08:00
parent 6458e7dcca
commit b323a64b0b
5 changed files with 190 additions and 211 deletions

View File

@@ -1,6 +1,7 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from core.post_ops import negotiation_strategy_reply
if TYPE_CHECKING:
from core.pydantic_ai_agent import AgentDeps, ConversationState, CustomerMessage, CustomerServiceAgent
@@ -69,7 +70,7 @@ async def execute_ai_turn(
agent.message_histories[message.from_id] = result.all_messages()[-30:]
reply_text = agent._colloquialize_reply(agent._normalize_reply_text(result.output))
strategy_reply = agent._negotiation_strategy_reply(message.msg, state)
strategy_reply = negotiation_strategy_reply(message.msg, state)
if strategy_reply:
reply_text = strategy_reply