Can't use SQLdatabasechain with Multipromptchain 
Labels: name: auto:bug




**When i try to use Multiprompt chain  getting the below error. Any Suggestions for Solving this Issue??**


ValidationError: 16 validation errors for MultiPromptChain destination_chains -> list -> database extra fields not permitted (type=value_error.extra) destination_chains -> list -> input_key extra fields not permitted (type=value_error.extra) destination_chains -> list -> llm_chain extra fields not permitted (type=value_error.extra) destination_chains -> list -> query_checker_prompt extra fields not permitted (type=value_error.extra) destination_chains -> list -> return_direct extra fields not permitted (type=value_error.extra) destination_chains -> list -> return_intermediate_steps extra fields not permitted (type=value_error.extra) destination_chains -> list -> top_k extra fields not permitted (type=value_error.extra) destination_chains -> list -> use_query_checker extra fields not permitted (type=value_error.extra) destination_chains -> query -> database extra fields not permitted (type=value_error.extra) destination_chains -> query -> input_key extra fields not permitted (type=value_error.extra) destination_chains -> query -> llm_chain extra fields not permitted (type=value_error.extra) destination_chains -> query -> query_checker_prompt extra fields not permitted (type=value_error.extra) destination_chains -> query -> return_direct extra fields not permitted (type=value_error.extra) destination_chains -> query -> return_intermediate_steps extra fields not permitted (type=value_error.extra) destination_chains -> query -> top_k extra fields not permitted (type=value_error.extra) destination_chains -> query -> use_query_checker extra fields not permitted (type=value_error.extra)


**Getting the Above error when i try to Use the Below code. Any Suggestions to Solve the Above error??**


physics_template = """You are a very smart Chatbot for helping users with physics-related questions. \
You excel at answering queries about the laws of nature and phenomena. \
When you don't have an answer, you admit that you don't know.

Here is a physics question:
{input}"""

math_template = """You are a highly skilled mathematician Chatbot. \
You specialize in answering math questions of all levels of difficulty. \
You break down complex problems into simpler components and provide comprehensive solutions.

Here is a math question:
{input}"""

prompt_infos = [
    {
        "name": "list",
        "description": "Good for answering questions about query the data",
        "prompt_template": physics_template,
    },
    {
        "name": "query",
        "description": "Good for answering math questions",
        "prompt_template": math_template,
    },
]

db = SQLDatabase.from_uri(
    **"YOUR DATABASE URI")**


llm = OpenAI(temperature=0, model="text-davinci-003", max_tokens=1000,
                  openai_api_key="**YOUR OPENAI API KEY**")
destination_chains = {}
textcontainer = st.container()
with textcontainer:
    input = st.text_input("Query: ", key="input")
    if input:
     for p_info in prompt_infos:
         name = p_info["name"]
         prompt_template = p_info["prompt_template"]
         prompt = PromptTemplate(template=prompt_template, input_variables=["input"])
         db_chain = SQLDatabaseChain(
    llm=llm, database=db, verbose=True,prompt=prompt)
         destination_chains[name] =  db_chain
      
     default_chain = ConversationChain(llm=llm, output_key="text")
     destinations = [f"{p['name']}: {p['description']}" for p in prompt_infos]
     destinations_str = "\n".join(destinations)
     router_template = MULTI_PROMPT_ROUTER_TEMPLATE.format(destinations=destinations_str)
     router_prompt = PromptTemplate(
         template=router_template,
         input_variables=["input"],
         output_parser=RouterOutputParser(),
     )
     router_chain = LLMRouterChain.from_llm(llm, router_prompt)
     db_chain = MultiPromptChain(
         router_chain=router_chain,
         destination_chains=destination_chains,
         default_chain=default_chain,
         verbose=True,
     )


### Suggestion:

_No response_