Canner / WrenAI

šŸš€ An open-source SQL AI (Text-to-SQL) Agent that empowers data, product teams to chat with their data. šŸ¤˜
https://getwren.ai/oss
GNU Affero General Public License v3.0
2.04k stars 211 forks source link

Feature: implement feedback loop explain process #528

Closed onlyjackfrost closed 3 months ago

onlyjackfrost commented 4 months ago

implement feedback loop explain process

API

input CreateThreadResponseExplainWhereInput { responseId: Int! }


- Exist Query:  thread
```graphql
thread(threadId: Int!): DetailedThread!

type DetailedThread {
    id: Int!
    sql: String!
      @deprecated(
        reason: "Doesn't seem to be reasonable to put a sql in a thread"
      )
    summary: String!
    responses: [ThreadResponse!]!
  }

type ThreadResponse {
    id: Int!
    question: String!
    summary: String!
    status: AskingTaskStatus!
    detail: ThreadResponseDetail
    error: Error
    corrections: [CorrectionDetail!]
    explain: ThreadResponseExplainInfo!   # new added
  }

type ThreadResponseExplainInfo {
    queryId: String
    status: String
    error: JSON
  }

(Refer to the type definition above)



### Example screenshot
<img width="1884" alt="image" src="https://github.com/user-attachments/assets/90465376-452d-4e28-a6cb-d74d2fb40425">

<img width="1041" alt="image" src="https://github.com/user-attachments/assets/57dae530-8095-4a9e-b932-78a851639145">