MCPcopy Create free account
hub / github.com/THUDM/AgentBench / prompter

Method prompter

src/client/agents/http_agent.py:83–94  ·  view source on GitHub ↗
(messages: List[Dict[str, str]])

Source from the content-addressed store, hash-verified

81 agent_role: str = "agent",
82 ):
83 def prompter(messages: List[Dict[str, str]]):
84 nonlocal message_key, role_key, content_key, user_role, agent_role
85 role_dict = {
86 "user": user_role,
87 "agent": agent_role,
88 }
89 prompt = []
90 for item in messages:
91 prompt.append(
92 {role_key: role_dict[item["role"]], content_key: item["content"]}
93 )
94 return {message_key: prompt}
95
96 return prompter
97

Callers 1

_handle_historyMethod · 0.45

Calls 1

role_content_dictMethod · 0.80

Tested by

no test coverage detected