Urgent.News

What's breaking now, across thousands of outlets.

AI

Your Chatbot Verified the Price, Then Pasted It Into a Sentence It Wrote

A grounded chatbot retrieves the right catalog rows, asks the model which price it used, looks that price up, and compares. Mine did all of that and still quoted a stale price to a customer. The retrieval was fine. The verification was fine. The line that broke it was the one that came after: answer = answer . replace ( String ( out . priceUsed ), String ( livePrice )); The model had reported…

A chatbot retrieved the right catalog rows, verified a price, and wrote it into a sentence. The verification process worked well, but the sentence the bot generated still contained the old price, leaving the customer with outdated information. The issue lies in the model's ability to write sentences containing numbers, as it is not guaranteed that the numbers it generates will be verified and accurate.

The verification process only ensures the correctness of the number itself, not how the number is presented within the sentence. To address this problem, the solution suggests using templates instead of allowing the model to write complete sentences. By providing a template with named slots for numbers, the code can fill in the slots with verified values, ensuring that the final sentence contains only verified and accurate information.

This approach prevents the model from writing numbers directly and eliminates the need for complex string operations to verify and format the numbers.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

More from Monday 7 September →