-
Notifications
You must be signed in to change notification settings - Fork 11
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
Extract query from text2sql agent #158
Conversation
Introduced a `MindsDBSQLStreamParser` class to facilitate debugging and SQL query extraction from MindsDB completion streams. Updated the text2sql examples to implement the new parser and modified model name handling for consistency.
Introduced a `MindsDBSQLStreamParser` class to facilitate debugging and SQL query extraction from MindsDB completion streams. Updated the text2sql examples to implement the new parser and modified model name handling for consistency.
@martyna-mindsdb fyi this updates some of the sdk examples |
Consolidate various log statements for better visibility at `INFO` level. Remove redundant debug-level logging in `using_agents_with_text2sql_streaming.py` and streamline MindsDBSQLStreamParser instantiation.
@dusvyat Here is the current SDK example from docs. Please let me know if there is anything that changes from user's perspective, or anything that should be better emphasized in docs. |
@martyna-mindsdb no doc changes required, just tagging as an FYI |
Refactor the agent utils to log SQL queries directly from chunk content instead of extracting from actions. This simplifies the process and removes redundant code related to action handling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but what happens when the CoT runs multiple SQL queries. Shouldn't we return the last SQL query?
@QuantumPlumber As it stands, only last query that was generated is returned. Hence it accounts for scenarios where |
Introduce comprehensive tests for MindsDBSQLStreamParser functionality. Included tests cover initialization, streaming and parsing SQL queries with both dict and string inputs, and processing streams with and without SQL content.
This introduces some utilities to the sdk for parsing streaming completions for text2sql agents
depends on mindsdb/mindsdb#9698
part of ML-129