I'm using langchain and OpenAI to implement a natural language to SQL query tool. It works okay for schemas with a small number of simple tables. However, when I try to use it for schemas that have many tables or fewer tables with many columns, the prompt which includes all table structures exceeds the token limit for the OpenAI completion service.
I tried limiting the prompt to include just the table and column names without column data type or constraint information, but the prompt still exceeds the token limit.