update:智控台,intent_llmM供应器增加functions输入框

This commit is contained in:
hrz
2025-05-09 15:23:12 +08:00
parent 15263b5223
commit 61c2782491
4 changed files with 18 additions and 31 deletions
@@ -112,7 +112,7 @@ async def process_intent_result(conn, intent_result, original_text):
elif result.action == Action.REQLLM: # 调用函数后再请求llm生成回复
text = result.result
conn.dialogue.put(Message(role="tool", content=text))
llm_result = conn.intent.replyResult(text)
llm_result = conn.intent.replyResult(text, original_text)
if llm_result is None:
llm_result = text
speak_and_play(conn, llm_result)
@@ -105,10 +105,11 @@ class IntentProvider(IntentProviderBase):
for key, _ in sorted_items[: len(sorted_items) - self.cache_max_size]:
del self.intent_cache[key]
def replyResult(self, text: str):
def replyResult(self, text: str, original_text: str):
llm_result = self.llm.response_no_stream(
system_prompt=text,
user_prompt="总结以上内容,像人类一样说话的口吻回复用户,要求简洁,请直接返回结果。",
user_prompt="根据以上内容,像人类一样说话的口吻回复用户,要求简洁,请直接返回结果。用户现在说:"
+ original_text,
)
return llm_result