from langchain_core.prompts import ChatPromptTemplate template = """Based on the table schema below, write a SQL query that would answer the user's question: {context} Question: {question} SQL Query:""" prompt = ChatPromptTemplate.from_messages( [ ("system", "Given an input question, convert it to a SQL query. No pre-amble."), ("human", template), ] )