Skip to content

Commit 492f41b

Browse files
committed
Processing update
1 parent c0c630c commit 492f41b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

text_2_sql/autogen/src/autogen_text_2_sql/autogen_text_2_sql.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
ProcessingUpdate,
2727
)
2828
from autogen_agentchat.base import Response, TaskResult
29-
from asyncio import AsyncGenerator
29+
from typing import AsyncGenerator
3030

3131

3232
class EmptyResponseUserProxyAgent(UserProxyAgent):
@@ -132,7 +132,7 @@ async def process_question(
132132
question: str,
133133
chat_history: list[str] = None,
134134
parameters: dict = None,
135-
) -> AsyncGenerator[AnswerWithSources | UserInformationRequest]:
135+
) -> AsyncGenerator[AnswerWithSources | UserInformationRequest, None]:
136136
"""Process the complete question through the unified system.
137137
138138
Args:
@@ -169,23 +169,23 @@ async def process_question(
169169
if message.source == "query_rewrite_agent":
170170
# If the message is from the query_rewrite_agent, we need to update the chat history
171171
payload = ProcessingUpdate(
172-
title="Rewriting the query...",
172+
message="Rewriting the query...",
173173
)
174174
elif message.source == "parallel_query_solving_agent":
175175
# If the message is from the parallel_query_solving_agent, we need to update the chat history
176176
payload = ProcessingUpdate(
177-
title="Solving the query...",
177+
message="Solving the query...",
178178
)
179179
elif message.source == "answer_agent":
180180
# If the message is from the answer_agent, we need to update the chat history
181181
payload = ProcessingUpdate(
182-
title="Generating the answer...",
182+
message="Generating the answer...",
183183
)
184184

185185
elif isinstance(message, TaskResult):
186186
# Now we need to return the final answer or the disambiguation request
187187

188-
if message.task == "answer_agent":
188+
if message.source == "answer_agent":
189189
# If the message is from the answer_agent, we need to return the final answer
190190
payload = AnswerWithSources(
191191
**json.loads(message.content),
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from pydantic import BaseModel
1+
from pydantic import BaseModel, Field
22

33

44
class ProcessingUpdate(BaseModel):
5-
title: str
6-
message: str
5+
title: str | None = Field(default="Processing...")
6+
message: str | None = Field(default="Processing...")

0 commit comments

Comments
 (0)