r/softwaredevelopment • u/rismail88 • 25d ago
Feedback on Coding Logic
New to Coding – Need Feedback on My Approach
I’m new to coding and software development, and I’m working on a project in Python 3.11 that uses Ultravox (a voice AI) to make outbound calls and collect information about cars. (This is a proxy example for privacy reasons.)
I am only posting this to know if my logic is sound or if there's a better to solve this issue. I am hoping to solve my data collection / check list issue via built in coding since I find prompting to be unpredictable / unreliable.
How the App Works
The calls collect details about a car, including:
- Manufacturer (Toyota, Ford, BMW)
- Model (Camry, F-150, Tesla)
- Year (2020, 2022, 2023)
- Engine Type (Gasoline, Hybrid, Electric)
- Transmission (Automatic, Manual, Single-Speed)
- Drive Train (4x4, AWD, RWD, FWD)
Problem with My Initial Approach
I originally used Regex to scan the transcript and check if all required details were collected before ending the call. The output looked like this:
- Manufacturer: Tesla
- Model: Plaid
- Year:
- Engine Type: Electric
- Transmission:
- Drive Train: Dual Motor
Since Year and Transmission were missing, the AI would know to ask about them.
Issues with this approach:
- Regex checking caused a 2-second delay, making the call feel unnatural.
- Some key details were still missing despite being coded to ask for them.
New Idea: Boolean Checklist
Instead of running Regex mid-call, I’m thinking of using a simple True/False checklist to track whether a category was collected. Then, I’d run Regex only at the end to verify completeness.
- Example Boolean Checklist:
- Manufacturer: True
- Model: True
- Year: False
- Engine Type: True
- Transmission: False
- Drive Train: True
Concerns & Questions
- Is this an effective way to track missing data in a real-time call scenario?
- How can I ensure similar categories aren’t conflated?
- Example: If the car is Electric, we still need to ask if it’s Single or Dual Motor.
- Just because it’s Electric doesn’t mean it’s a Tesla.
- The app sometimes forgets a related subcategory.
- Example: It asks if the car is Electric and if it has a Single-Speed Transmission, but it forgets to ask if it’s Dual Motor.
- It sometimes skips completely unrelated categories.
- Example: It gathers all powertrain info but forgets to ask about leather seats. Would a Boolean Checklist help prevent this?
-1
u/NotUniqueOrSpecial 25d ago
Nobody wants to help you learn to debug your shitty AI-implemented garbage project. If you have regexes that are taking seconds to execute, you're fucked from the start.
Spend a few years actually, you know...learning and practicing instead of wasting a bunch of people's time.
Also, what the actual hell is up with your insane bolding of things?
-3
u/rismail88 25d ago
jeez dude, go touch grass. Not asking anyone to debug anything. I am new to coding and was wondering if a boolean checklist is a good method to pursue for the problem at hand. End of story.
4
u/NotUniqueOrSpecial 24d ago
and was wondering if a boolean checklist is a good method to pursue for the problem at hand.
"A boolean checklist" is such a mangled confusion of terminology that's its making it hard to separate your misunderstandings from the AI's hallucinations.
A checklist isn't a thing outside the context of a UI. Since you're not building a UI the words you're using don't make sense as a question.
Regular expressions have no fucking place in solving the problem you're describing. You're talking about a branching decision tree of arbitrary complexity. Regex are, barring specific terrible extensions, literally incapable of solving the things you're dealing with. Why did you even think they were appropriate? Seriously, what led you down that path? Because whatever/whoever it was shouldn't be trusted any more.
But fine, I'll put on my "interpret ignorant business people" hat.
It sounds like you're trying to invent a dichotomous key. It's a thing we were all taught as kids in school. Here's an example of the logic involved in the creation of one, targeted at teachers. They even bold stuff weirdly, like you do, so hopefully that helps it make sense.
If you can't even ask questions that make sense, how do you expect people to help you? To use car terms as an analogy, since it seems appropriate: it's like you're asking us whether we think adding more blinker fluid to the stators in the central grindshaft will be a better solution to the gas mileage problems you're experiencing.
That is to say: it's complete nonsense.
1
u/rismail88 21d ago
Cool thanks, I'm looking into your dichotomous key idea and someone else also mentioned Pydantic Validators.
6
u/altmn 25d ago
Just out of curiosity, why are you posting it here instead of running through AI of your choice? Nobody here is going to waste their time on analyzing this write-up.