MCPcopy Create free account
hub / github.com/Tencent/digitalhuman / call_npc

Function call_npc

SAGE/npc_response.py:11–24  ·  view source on GitHub ↗
(player_history)

Source from the content-addressed store, hash-verified

9
10
11def call_npc(player_history):
12
13 # use player_history to build the chat message
14 role_system = '''你是一个智能聊天伙伴,你擅长高情商地和用户聊天,让用户感到舒适、愉快或得到需要的帮助。'''
15 history = [{"role": "system", "content": role_system}]
16 for mes in player_history:
17 if mes["role"]=="user":
18 history.append({"role": "user", "content": mes["content"]})
19 else:
20 history.append({"role": "assistant", "content": mes["content"]})
21
22 ret = call_llm(history)
23
24 return ret
25

Callers 1

test_npc.pyFile · 0.90

Calls 2

appendMethod · 0.80
call_llmFunction · 0.70

Tested by

no test coverage detected