|
26 | 26 | ProcessingUpdate, |
27 | 27 | ) |
28 | 28 | from autogen_agentchat.base import Response, TaskResult |
29 | | -from asyncio import AsyncGenerator |
| 29 | +from typing import AsyncGenerator |
30 | 30 |
|
31 | 31 |
|
32 | 32 | class EmptyResponseUserProxyAgent(UserProxyAgent): |
@@ -132,7 +132,7 @@ async def process_question( |
132 | 132 | question: str, |
133 | 133 | chat_history: list[str] = None, |
134 | 134 | parameters: dict = None, |
135 | | - ) -> AsyncGenerator[AnswerWithSources | UserInformationRequest]: |
| 135 | + ) -> AsyncGenerator[AnswerWithSources | UserInformationRequest, None]: |
136 | 136 | """Process the complete question through the unified system. |
137 | 137 |
|
138 | 138 | Args: |
@@ -169,23 +169,23 @@ async def process_question( |
169 | 169 | if message.source == "query_rewrite_agent": |
170 | 170 | # If the message is from the query_rewrite_agent, we need to update the chat history |
171 | 171 | payload = ProcessingUpdate( |
172 | | - title="Rewriting the query...", |
| 172 | + message="Rewriting the query...", |
173 | 173 | ) |
174 | 174 | elif message.source == "parallel_query_solving_agent": |
175 | 175 | # If the message is from the parallel_query_solving_agent, we need to update the chat history |
176 | 176 | payload = ProcessingUpdate( |
177 | | - title="Solving the query...", |
| 177 | + message="Solving the query...", |
178 | 178 | ) |
179 | 179 | elif message.source == "answer_agent": |
180 | 180 | # If the message is from the answer_agent, we need to update the chat history |
181 | 181 | payload = ProcessingUpdate( |
182 | | - title="Generating the answer...", |
| 182 | + message="Generating the answer...", |
183 | 183 | ) |
184 | 184 |
|
185 | 185 | elif isinstance(message, TaskResult): |
186 | 186 | # Now we need to return the final answer or the disambiguation request |
187 | 187 |
|
188 | | - if message.task == "answer_agent": |
| 188 | + if message.source == "answer_agent": |
189 | 189 | # If the message is from the answer_agent, we need to return the final answer |
190 | 190 | payload = AnswerWithSources( |
191 | 191 | **json.loads(message.content), |
|
0 commit comments