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 sqlalchemy support and mongodb support #321

Merged
merged 21 commits into from
Feb 13, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update prompt for local model. Add dependency to requirements.full
zhangyongchao committed Oct 31, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit cbdd520363ccfb2a9ae020ea64e82aef4851c285
2 changes: 1 addition & 1 deletion lazyllm/tools/sql/sql_manager.py
Original file line number Diff line number Diff line change
@@ -410,7 +410,7 @@ def __init__(self, db_file: str, tables_info_dict: dict = {}):
raise ValueError(self.detail)

def reset_engine(self, db_file: str, tables_info_dict: dict):
self.db_type = "sqlite"
self._db_type = "sqlite"
self.status = DBStatus.SUCCESS
self.detail = ""
if not Path(db_file).is_file():
4 changes: 2 additions & 2 deletions lazyllm/tools/sql_call/sql_call.py
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@

{desc}

Alert: Just replay the sql query in a code block start with keyword "sql"
Alert: Just replay the sql query in a code block start with triple-backticks and keyword "sql"
""" # noqa E501


@@ -24,7 +24,7 @@

{desc}

Note: Please return the json pipeline in a code block and start with the keyword "json".
Note: Please return the json pipeline in a code block start with triple-backticks and keyword "json".
""" # noqa E501

db_explain_instruct_template = """
1 change: 1 addition & 0 deletions requirements.full.txt
Original file line number Diff line number Diff line change
@@ -65,3 +65,4 @@ infinity-emb
ctranslate2
optimum>=1.16.2
typer
pymongo
94 changes: 0 additions & 94 deletions tests/charge_tests/test_mongodb_manager.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/charge_tests/test_sql_tool.py
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ def setUpClass(cls):
assert db_result.status == DBStatus.SUCCESS, db_result.detail

# Recommend to use sensenova, gpt-4o, qwen online model
sql_llm = lazyllm.OnlineChatModule(source="sensenova")
sql_llm = lazyllm.OnlineChatModule(source="qwen")
cls.sql_calls: list[SqlCall] = []
for sql_manager in cls.sql_managers:
cls.sql_calls.append(SqlCall(sql_llm, sql_manager, use_llm_for_sql_result=True))