Is there anyone that can help me on implementing a chat with database datas using langchain js and open ai in node js?

Hi guys, Im trying to implement a chat with my database datas by using langchain js and open ai in node js but Im having problems at doing it for the reason that my endpoint is failing with an error: Failed to calculate number of tokens, falling back to approximate count.
The code that Im using is like below:

import { OpenAI } from "langchain/llms/openai";
import { SqlDatabase } from "langchain/sql_db";
import { SqlDatabaseChain } from "langchain/chains/sql_db";
import { DataSource } from "typeorm";

const langchainController = async () => {
  const datasource = new DataSource({
    type: "postgres",
    url: "my db url",
    logging: false,
    synchronize: true,
    extra: {
      ssl: {
        rejectUnauthorized: false,
      },
    },
  });

  const db = await SqlDatabase.fromDataSourceParams({
    appDataSource: datasource,
  });

  const chain = new SqlDatabaseChain({
    llm: new OpenAI({
      temperature: 0,
      openAIApiKey: "my api key",
    }),
    database: db,
  });

  const res = await chain.run("How many products are available now?");
  console.log(res);
};
export { langchainController };

After doing a request to this endpoint Im seeing 2 problems:

  1. The time to get a response from this endpoint is taking so much time around 2 minutes.
  2. At the end an error is shown: Failed to calculate number of tokens, falling back to approximate count

but even that I have these 2 problems like above Im getting a correct answer from this endpoint.

I want to resolve these 2 problems and I don’t have any idea where is the problem. I have tried to create a simple database with just 1 table that has just 6 rows inside of it and Im getting the same problems. I have opened this issue on langchain js github but I didn’t get any solution that can help me on my case.

can anybody help me on the question above please?