Skip to content

Commit

Permalink
chore(wren-ai-service): add correcting status (#873)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyyeh authored Nov 6, 2024
1 parent 80a907c commit c63c933
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion wren-ai-service/src/web/v1/routers/ask.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
- **Path Parameter**:
- `query_id`: The unique identifier of the query.
- **Response**:
- `status`: The current status of the query (`"understanding"`, `"searching"`, `"generating"`, `"finished"`, `"failed"`, or `"stopped"`).
- `status`: The current status of the query (`"understanding"`, `"searching"`, `"generating"`, `"correcting"`, `"finished"`, `"failed"`, or `"stopped"`).
- `response`: (Optional) A list of SQL results, each containing:
- `sql`: The generated SQL statement.
- `summary`: A summary of the SQL statement.
Expand Down
12 changes: 11 additions & 1 deletion wren-ai-service/src/web/v1/services/ask.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,13 @@ class AskResultRequest(BaseModel):

class AskResultResponse(BaseModel):
status: Literal[
"understanding", "searching", "generating", "finished", "failed", "stopped"
"understanding",
"searching",
"generating",
"correcting",
"finished",
"failed",
"stopped",
]
response: Optional[List[AskResult]] = None
error: Optional[AskError] = None
Expand Down Expand Up @@ -267,6 +273,10 @@ async def ask(
"invalid_generation_results"
]
):
self._ask_results[query_id] = AskResultResponse(
status="correcting",
)

sql_correction_results = await self._pipelines[
"sql_correction"
].run(
Expand Down

0 comments on commit c63c933

Please sign in to comment.