MCPcopy Create free account
hub / github.com/KerwinMai/Multi-Agent-Exp / query

Method query

agent.py:128–146  ·  view source on GitHub ↗

执行查询(阻塞式,返回完整回答) Args: question: 用户问题 Returns: 回答结果

(self, question: str)

Source from the content-addressed store, hash-verified

126 return False
127
128 def query(self, question: str) -> str:
129 """执行查询(阻塞式,返回完整回答)
130
131 Args:
132 question: 用户问题
133
134 Returns:
135 回答结果
136 """
137 if not self.user_id:
138 return "请先登录。您可以输入任意用户ID开始使用。"
139
140 thread_id = f"{self.user_id}_{self.session_id}"
141
142 return self.master_agent.query(
143 question,
144 thread_id=thread_id,
145 user_id=self.user_id
146 )
147
148 def stream_query(self, question: str):
149 """流式查询,返回 SSE 事件生成器

Callers 2

mainFunction · 0.95
queryFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected