Hello everyone,
I'm currently working with ChatGPT 4.1 and the Tool Connector to input data into a structured SQL table within Supabase (not a vector table). The agent's role is to parse user input and extract two essential fields:
amount
(integer)next_date_to_pay
(timestamp/date in ISO format)
Following extraction, it invokes a tool to insert these values into the table. The table schema has NOT NULL constraints for both of these fields.
Despite the agent appearing to extract both values accurately, the tool invocation frequently fails with the following error:
Bad request - please check your parameters: null value in column "amount" of relation "test_table_for_savings" violates not-null constraint
This situation appears to be a common workflow: extract → validate → insert into SQL. Has anyone else encountered similar problems, or successfully set up a system where an AI interacts with Supabase for inserting or updating data (beyond just reading)?
I would appreciate any insights or examples of successful implementations.
Hello! I hope you are doing well. Welcome to the community.
Could you please share your workflow? This would help us see how you're performing the insertion and review your prompts.
In the meantime, here's a working example of what I believe you're looking for:
Output in chat:
Output from the database:
Hello, and thank you for your reply with the example.
I've identified the difference between your setup and mine. It appears I had explicitly defined the parameters to be filled within the Supabase tool, leaving the rest to the AI. My assumption was that it would all work seamlessly, so I omitted these fields, whereas you included them. I've replicated your approach, and it's now functioning correctly. Thanks again!
Awesome. Glad I could help, kindly
the answer which helped to figure out the issue.
Cheers.