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

Add to BaseSQLTableQueryEngine refine synthesis template #11378

Merged
merged 3 commits into from
Mar 6, 2024

Conversation

keligggg
Copy link
Contributor

@keligggg keligggg commented Feb 25, 2024

Description

Adds the ability to choose a template for the prompt that refine the response from a BaseSQLTableQueryEngine.

Type of Change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • I stared at the code and made sure it makes sense

Suggested Checklist:

  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I ran make format; make lint to appease the lint gods

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 25, 2024
@@ -359,10 +368,14 @@ def _query(self, query_bundle: QueryBundle) -> Response:
partial_synthesis_prompt = self._response_synthesis_prompt.partial_format(
sql_query=sql_query_str,
)
partial_refine_prompt = self._refine_synthesis_prompt.partial_format(
sql_query=sql_query_str,
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm, the DEFAULT_REFINE_PROMPT does not have a sql_query variable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, it's been fixed

@@ -386,10 +396,14 @@ async def _aquery(self, query_bundle: QueryBundle) -> Response:
partial_synthesis_prompt = self._response_synthesis_prompt.partial_format(
sql_query=sql_query_str,
)
partial_refine_prompt = self._refine_synthesis_prompt.partial_format(
sql_query=sql_query_str,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I still think theres an issue here -- the default refine synthesis prompt still doesn't have this variable. I think we need a V2 version of this prompt, similar to the main default prompt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad, I just corrected

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 6, 2024
@logan-markewich logan-markewich merged commit 8cdbf61 into run-llama:main Mar 6, 2024
8 checks passed
Izukimat pushed a commit to Izukimat/llama_index that referenced this pull request Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants