Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wren-ui): Epic intention + recommend question #876

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

onlyjackfrost
Copy link
Contributor

@onlyjackfrost onlyjackfrost commented Nov 7, 2024

GraphQL

Query getThreadRecommendationQuestions

query GetThreadRecommendationQuestions($threadId: Int!) {
  getThreadRecommendationQuestions(threadId: $threadId) {
    status
    questions {
      question
      sql
      explanation
    }
    error {
      code
      shortMessage
      message
      stacktrace
    }
  }
}

{
  threadId: number
}

Query getProjectRecommendationQuestions

query GetProjectRecommendationQuestions {
  getProjectRecommendationQuestions {
    status
    questions {
      question
      sql
      explanation
    }
    error {
      code
      shortMessage
      message
      stacktrace
    }
  }
}

There are 4 kinds of status in getThreadRecommendationQuestions & getProjectRecommendationQuestions.
NOT_STARTED - There are no recommended questions, and no pipeline is performing the recommendation action.
GENERATING - There is a pipeline performing the recommendation action, fetch again later to get the recommendation.
FINISHED - The pipeline finished the recommendation action
ERROR - The pipeline encounters error and can not finished the task.

Mutation generateProjectRecommendationQuestions

mutation GenerateProjectRecommendationQuestions {
  generateProjectRecommendationQuestions
}

Mutation generateThreadRecommendationQuestions

mutation Mutation($threadId: Int!) {
  generateThreadRecommendationQuestions(threadId: $threadId)
}

Screenshots

generateThreadRecommendationQuestions
image

getThreadRecommendationQuestions- NOT_STARTED
image

getThreadRecommendationQuestions- GENERATING
image

getThreadRecommendationQuestions- FINISHED
image

getProjectRecommendationQuestions-GENERATING
image

getProjectRecommendationQuestions-FINISHED
image
image

generateProjectRecommendationQuestions
image

@onlyjackfrost onlyjackfrost marked this pull request as draft November 7, 2024 03:05
@wwwy3y3 wwwy3y3 changed the title feat(wren-ui): Epic intension + recommend question feat(wren-ui): Epic intention + recommend question Nov 10, 2024
- move the type definition to /models to avoid "ReferenceError: Cannot access 'IbisAdaptor' before initialization "
Comment on lines +390 to +398
const tasks = this.threadRecommendQuestionBackgroundTracker.getTasks();
const taskKey =
this.threadRecommendQuestionBackgroundTracker.taskKey(thread);
if (tasks[taskKey]) {
logger.debug(
`thread "${threadId}" recommended questions are generating, skip the current request`,
);
return;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you could implement a method like: getTask or ifExists to check the existence of task with thread id.

Copy link
Member

@wwwy3y3 wwwy3y3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

others lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants