|
@@ -8,6 +8,7 @@ from pqai_agent.response_type_detector import ResponseTypeDetector
|
|
from pqai_agent.user_profile_extractor import UserProfileExtractor
|
|
from pqai_agent.user_profile_extractor import UserProfileExtractor
|
|
from pqai_agent.dialogue_manager import DialogueManager
|
|
from pqai_agent.dialogue_manager import DialogueManager
|
|
from pqai_agent.message import MessageType
|
|
from pqai_agent.message import MessageType
|
|
|
|
+from pqai_agent.utils.prompt_utils import format_agent_profile
|
|
|
|
|
|
logger = logging_service.logger
|
|
logger = logging_service.logger
|
|
|
|
|
|
@@ -83,7 +84,7 @@ def run_extractor_prompt(req_data):
|
|
dialogue_history = req_data["dialogue_history"]
|
|
dialogue_history = req_data["dialogue_history"]
|
|
model_name = req_data["model_name"]
|
|
model_name = req_data["model_name"]
|
|
prompt_context = {
|
|
prompt_context = {
|
|
- **staff_profile,
|
|
|
|
|
|
+ "formatted_staff_profile": format_agent_profile(staff_profile),
|
|
**user_profile,
|
|
**user_profile,
|
|
"dialogue_history": UserProfileExtractor.compose_dialogue(dialogue_history),
|
|
"dialogue_history": UserProfileExtractor.compose_dialogue(dialogue_history),
|
|
}
|
|
}
|
|
@@ -114,7 +115,10 @@ def run_chat_prompt(req_data):
|
|
dialogue_history = req_data.get("dialogue_history", [])
|
|
dialogue_history = req_data.get("dialogue_history", [])
|
|
model_name = req_data["model_name"]
|
|
model_name = req_data["model_name"]
|
|
current_timestamp = req_data["current_timestamp"] / 1000
|
|
current_timestamp = req_data["current_timestamp"] / 1000
|
|
- prompt_context = {**staff_profile, **user_profile}
|
|
|
|
|
|
+ prompt_context = {
|
|
|
|
+ 'formatted_staff_profile': format_agent_profile(staff_profile),
|
|
|
|
+ **user_profile
|
|
|
|
+ }
|
|
current_hour = datetime.fromtimestamp(current_timestamp).hour
|
|
current_hour = datetime.fromtimestamp(current_timestamp).hour
|
|
prompt_context["last_interaction_interval"] = 0
|
|
prompt_context["last_interaction_interval"] = 0
|
|
prompt_context["current_time_period"] = DialogueManager.get_time_context(
|
|
prompt_context["current_time_period"] = DialogueManager.get_time_context(
|