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-ai-service): sql-expansion #667

Merged
merged 30 commits into from
Sep 19, 2024
Merged

Conversation

cyyeh
Copy link
Member

@cyyeh cyyeh commented Sep 13, 2024

  • refactoring
    • remove global variables
    • restructuring pipelines
    • fix test command in Justfile
  • sql-expansion

@cyyeh cyyeh added module/ai-service ai-service related ci/ai-service ai-service related labels Sep 13, 2024
@cyyeh cyyeh requested a review from paopa September 13, 2024 06:56
@cyyeh cyyeh force-pushed the feat/ai-service/sql-add-columns branch from a33ebdc to 201abcf Compare September 13, 2024 09:36
@cyyeh cyyeh marked this pull request as ready for review September 18, 2024 05:51
@cyyeh
Copy link
Member Author

cyyeh commented Sep 18, 2024

image
image

there is issue in openai api currently, and we can safely merge this PR if no other issues

@@ -16,7 +17,7 @@


@component
class GenerationPostProcessor:
class SQLBreakdownGenerationPostProcessor:
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: its name seems a bit long, I think might be we can consider a shorten name for it. such as SQLBreakdownGenPostProcessor, SQLBreakdownPostProcessor, SQLBreakdownProcessor, etc... wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed, use SQLBreakdownGenPostProcessor. I also changed SQLGenerationPostProcessor to SQLGenPostProcessor

)
self.sql_regeneration_post_processor = GenerationPostProcessor(engine=engine)
self._components = {
"sql_regeneration_preprocesser": SQLRegenerationRreprocesser(),
Copy link
Member

Choose a reason for hiding this comment

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

here seems a typo.

Suggested change
"sql_regeneration_preprocesser": SQLRegenerationRreprocesser(),
"sql_regeneration_preprocessor": SQLRegenerationPreprocessor(),

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

Comment on lines 166 to 172
"sql_regeneration_prompt_builder": PromptBuilder(
template=sql_regeneration_user_prompt_template
),
"sql_regeneration_generator": llm_provider.get_generator(
system_prompt=sql_regeneration_system_prompt
),
"sql_regeneration_post_processor": SQLBreakdownGenerationPostProcessor(
Copy link
Member

Choose a reason for hiding this comment

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

I think we could consider removing the prefix sql_regeneration to be more concise.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

self._score_filter = ScoreFilter()
# todo: add a llm filter to filter out low scoring document
self._output_formatter = OutputFormatter()
_store = store_provider.get_store(dataset_name="view_questions")
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: I do believe there is you just forgot removing the underscore. 🤣

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@@ -96,7 +96,7 @@ async def execute_sql(
if response.status == 204:
return True, None, None

res = await response.json()
res = await response.text()
Copy link
Member

Choose a reason for hiding this comment

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

curiously, why did you change to use text method to get the response?

Copy link
Member Author

@cyyeh cyyeh Sep 18, 2024

Choose a reason for hiding this comment

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

reverted

@paopa paopa self-requested a review September 19, 2024 02:26
Copy link
Member

@paopa paopa left a comment

Choose a reason for hiding this comment

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

there has a minor comment for the test case. others LGTM. thanks for the hard work!

wren-ai-service/tests/pytest/services/test_ask.py Outdated Show resolved Hide resolved
wren-ai-service/tests/pytest/services/test_ask_details.py Outdated Show resolved Hide resolved
@cyyeh cyyeh merged commit c428bb0 into main Sep 19, 2024
8 checks passed
@cyyeh cyyeh deleted the feat/ai-service/sql-add-columns branch September 19, 2024 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/ai-service ai-service related module/ai-service ai-service related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants