Giter Site home page Giter Site logo

SQL error: execute() first about chatdb HOT 5 OPEN

huchenxucs avatar huchenxucs commented on July 27, 2024
SQL error: execute() first

from chatdb.

Comments (5)

ZhengChen6 avatar ZhengChen6 commented on July 27, 2024 1

image

image
Just add "`" like this!

from chatdb.

Prem95 avatar Prem95 commented on July 27, 2024

from chatdb.

potong avatar potong commented on July 27, 2024

It means your database is not connected

On Mon, 17 Jul 2023 at 6:14 PM, TianMin @.> wrote: [image: image] https://user-images.githubusercontent.com/10555409/253911188-a4906d0c-5071-45ee-869a-07c46d3c2f86.png — Reply to this email directly, view it on GitHub <#7>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDKTMVPCQ47PC7XG3GYHQTXQUF6VANCNFSM6AAAAAA2MW4OJY . You are receiving this because you are subscribed to this thread.Message ID: @.>

I see the problem here:
image

Change the pattern to:
pattern = r"Step(\d+):\s+(.?)\n(.)\n"

from chatdb.

tom68-ll avatar tom68-ll commented on July 27, 2024

Hello, author. We followed the advice and modified the pattern of the regular expression. However, this caused all the answers to the questions to include the phrase "not need memory". We suspect that there might still be an issue with the pattern here. @potong

from chatdb.

ATX735 avatar ATX735 commented on July 27, 2024

I try to ask the question "What was the total revenue for January 2023?", The LLM generates the following middle-stage answer:

` ` `
Step1: Calculate the total revenue for January 2023
SELECT SUM(total_price) AS total_revenue
FROM sales
WHERE sale_date >= '2023-01-01' AND sale_date <= '2023-01-31';
` ` `

Notice that, the SQL is not surrounded by backtick `. Therefore, causing the regular expression pattern pattern = r"Step(\d+):\s+(.*?)\n(.*?)" fail to match the SQL, which induces this error.
According to the prompt in this program, the LLM's output should look like the text that is shown below with the SQL surrounded by backtick `:

` ` `
Step1: Calculate the total revenue for January 2023
`SELECT SUM(total_price) AS total_revenue
FROM sales
WHERE sale_date >= '2023-01-01' AND sale_date <= '2023-01-31';`
` ` `

from chatdb.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.