Skip to content

Commit c954d9a

Browse files
committed
update
1 parent c85985e commit c954d9a

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

wren-ai-service/src/pipelines/generation/followup_sql_generation_reasoning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
{% for history in histories %}
5050
Question:
5151
{{ history.question }}
52-
SQL:
53-
{{ history.sql }}
52+
Response:
53+
{{ history.response }}
5454
{% endfor %}
5555
5656
### QUESTION ###

wren-ai-service/src/pipelines/generation/intent_classification.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@
170170
{% for history in histories %}
171171
Question:
172172
{{ history.question }}
173-
SQL:
174-
{{ history.sql }}
173+
Response:
174+
{{ history.response }}
175175
{% endfor %}
176176
{% endif %}
177177

wren-ai-service/src/pipelines/generation/utils/sql.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,9 @@ def construct_ask_history_messages(
515515
)
516516
messages.append(
517517
ChatMessage.from_assistant(
518-
history.sql if hasattr(history, "sql") else history["sql"]
518+
history.response
519+
if hasattr(history, "response")
520+
else history["response"]
519521
)
520522
)
521523
return messages

wren-ai-service/src/web/v1/services/ask.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
class AskHistory(BaseModel):
17-
sql: str
17+
response: str = Field(alias=AliasChoices("response", "sql"))
1818
question: str
1919

2020

@@ -229,7 +229,7 @@ async def ask(
229229
if self._allow_intent_classification:
230230
last_sql_data = None
231231
if histories:
232-
if last_sql := histories[-1].sql:
232+
if last_sql := histories[-1].response:
233233
last_sql_data = (
234234
await self._pipelines["sql_executor"].run(
235235
sql=last_sql,

0 commit comments

Comments
 (0)