mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-29 03:53:55 +08:00
@@ -38,6 +38,7 @@ class IntentProvider(IntentProviderBase):
|
||||
return prompt
|
||||
|
||||
async def detect_intent(self, dialogue_history: List[Dict], text:str) -> str:
|
||||
logger.bind(tag=TAG).info(f"分析用户意图: {text}")
|
||||
if not self.llm:
|
||||
raise ValueError("LLM provider not set")
|
||||
|
||||
@@ -55,6 +56,6 @@ class IntentProvider(IntentProviderBase):
|
||||
system_prompt=self.promot,
|
||||
user_prompt=user_prompt
|
||||
)
|
||||
|
||||
logger.bind(tag=TAG).info(f"Detected intent: {intent}")
|
||||
return intent.strip()
|
||||
intent_result = intent.strip()
|
||||
logger.bind(tag=TAG).info(f"意图识别结果: {intent_result}")
|
||||
return intent_result
|
||||
|
||||
Reference in New Issue
Block a user