Skip to content

fix: add default value for response parser. #2354

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jiaoqiyuan
Copy link
Contributor

@jiaoqiyuan jiaoqiyuan commented Feb 18, 2025

Description

fix #2158

In the ChatDB mode, when performing database Q&A based on the DeepSeek model, the returned data contains SQL but is not correctly parsed due to the absence of the direct_response field. Here, we set default empty string values for the display_type and direct_response fields to avoid situations where the large model cannot fully return as required (but still returns SQL), leading to an inability to answer questions.

How Has This Been Tested?

  • make fmt
  • make mypy
  • make test

Snapshots:

Response: Can not find sql in response:
image

It is because the returned JSON content includes thoughts, sql, and direct_response, but is missing display_type.
image

Checklist:

  • My code follows the style guidelines of this project
  • I have already rebased the commits and make the commit message conform to the project standard.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules

@github-actions github-actions bot added the fix Bug fixes label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [Module Name] ChatData error,Can not find sql in response
1 participant