Multiple database for NLtoSQL query engine #10005
Replies: 1 comment 1 reply
-
🤖 Hey there, @PradiptaAtByteIQMind-Graph2023! I'm Dosu, a friendly bot here to assist you while we wait for our human maintainers. I'm here to help you squash bugs, answer your questions, and guide you to be an awesome contributor. Don't hesitate to ask if you need anything! To connect multiple databases for a chatbot application using the NLtoSQL query engine, you can utilize the Here is a basic example of how you can use it: from llama_index.query_engine.sql_join_query_engine import SQLJoinQueryEngine
from llama_index.tools.query_engine import QueryEngineTool
from llama_index.indices.struct_store.sql_query import NLSQLTableQueryEngine
# Initialize your SQL query tools
sql_query_tool1 = QueryEngineTool(query_engine=NLSQLTableQueryEngine(database1))
sql_query_tool2 = QueryEngineTool(query_engine=NLSQLTableQueryEngine(database2))
# Initialize SQLJoinQueryEngine
sql_join_query_engine = SQLJoinQueryEngine(
sql_query_tool=sql_query_tool1,
other_query_tool=sql_query_tool2,
)
# Now you can use sql_join_query_engine to query your databases
response = sql_join_query_engine.query(query_bundle) In this example, Please replace You can find more details about the SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! Team
I want to connect with multiple databases for the chatbot application. how can i achieve this one?
Beta Was this translation helpful? Give feedback.
All reactions