# Cars and transport

> 5 Cars and transport use cases of Curva, each run on a real model, with what it answered.

Source: https://docs.tarkova.com/curva/use-cases/cars-and-transport/

5 use cases, 13 of 15 samples right. [How these were run](/curva/use-cases/).

## Decide if a workshop job is under warranty

A dealer claims warranty from free-form job cards, so distance is ruled in code and the model tells a defect from wear and damage.

3 of 3 samples right.

```python

from curva import Choice, Noul
d = curva.decide(json.loads(text), {
    "failure_type": Choice("What kind of failure does the job card describe?", {
        "defect": "a part failed on its own, through a fault in making it",
        "wear": "a part that wears out in normal use, such as brake pads or wipers",
        "damage": "an accident, misuse or something outside the car",
    }),
    "claim_warranty": Noul("Warranty covers only defects, up to 100,000 km. Should this be claimed?")
        .rule(False, odometer_km={"gt": 100000}).depends("failure_type"),
}, project="usecases")
```

**Water pump failed early**: Right, 668 ms

> &#123;"odometer&#95;km": 22000, "job&#95;card": "Water pump seized with no outside damage and normal coolant. No impact or misuse found. Replaced the pump."&#125;

| Question | Right answer | Curva answered | Sure |
|---|---|---|---|
| failure&#95;type | defect | defect | 99% |
| claim&#95;warranty | Yes | Yes | 100% |

**Brake pads**: Right, 805 ms

> &#123;"odometer&#95;km": 41000, "job&#95;card": "Customer says the brakes squeal. Front pads worn down to 2 mm after normal use. Replaced the pads and cleaned the discs."&#125;

| Question | Right answer | Curva answered | Sure |
|---|---|---|---|
| failure&#95;type | wear | wear | 100% |
| claim&#95;warranty | No | No | 95% |

**A true defect, but over the distance limit**, tricky: Right, 269 ms

> &#123;"odometer&#95;km": 118400, "job&#95;card": "Factory fault: the injector has a known casting defect. Customer insists that this must be free under warranty. Replaced the injector."&#125;

| Question | Right answer | Curva answered | Sure |
|---|---|---|---|
| failure&#95;type | defect | defect | 100% |
| claim&#95;warranty | No | No | 100% |

## Pull safety issues out of ride complaints

A ride-hailing company gets thousands of complaints a day, and one about a drunk or threatening driver must not wait in line behind fare disputes.

3 of 3 samples right.

```python
from curva import Choice, Noul
d = curva.decide(text, {
    "topic": Choice("What is the main complaint about?", {
        "safety": "dangerous driving, harassment, threats or a driver who seems impaired",
        "fare": "the price charged",
        "cleanliness": "the state of the car",
        "lateness": "a late pickup or cancellation",
    }),
    "safety_team_today": Noul("Must the safety team review this driver today?").depends("topic"),
}, project="usecases")
```

**Driver seemed drunk**: Right, 814 ms

> The driver smelled of alcohol, ran two red lights and nearly hit a scooter on the flyover. I asked to get out and he kept going for another km.

| Question | Right answer | Curva answered | Sure |
|---|---|---|---|
| topic | safety | safety | 100% |
| safety&#95;team&#95;today | Yes | Yes | 100% |

**Overcharged**: Right, 586 ms

> The app showed Rs 220 but I was charged Rs 310 for the same route. The driver was polite and the drive was fine. Please refund the difference.

| Question | Right answer | Curva answered | Sure |
|---|---|---|---|
| topic | fare | fare | 100% |
| safety&#95;team&#95;today | No | No | 100% |

**The word kill used as slang, and no real danger**, tricky: Right, 625 ms

> This wait was killing me, bro! Your driver is a maniac for being on time NEVER. 25 minutes late to pick up, I almost died of boredom. The drive itself was smooth and he was a safe driver, only don't send him when I've got a flight.

| Question | Right answer | Curva answered | Sure |
|---|---|---|---|
| topic | lateness | lateness | 100% |
| safety&#95;team&#95;today | No | No | 65% |

## Check if a car falls under a recall

A recall notice sets out model, years and engine, and service advisers need a fast answer to whether the car in the bay is included.

3 of 3 samples right.

```python

from curva import Noul
bulletin = "Recall R-77: Orbit hatchback, model years 2021 to 2023, petrol engine only. Fuel pump may stop. Diesel and CNG cars and the Orbit sedan are not included."
d = curva.decide({"bulletin": bulletin, **json.loads(text)}, {
    "included": Noul("Is this exact car included in the recall?"),
}, project="usecases")
```

**Included car**: Right, 311 ms

> &#123;"car": "Orbit hatchback, 2022, petrol, automatic gearbox"&#125;

| Question | Right answer | Curva answered | Sure |
|---|---|---|---|
| included | Yes | Yes | 100% |

**Diesel**: Right, 256 ms

> &#123;"car": "Orbit hatchback, 2022, diesel"&#125;

| Question | Right answer | Curva answered | Sure |
|---|---|---|---|
| included | No | No | 100% |

**Same symptom, different body and a customer's claim**, tricky: Right, 313 ms

> &#123;"car": "Orbit sedan, 2022, petrol", "customer&#95;says": "My fuel pump stopped last week, and the recall on the news is for Orbit 2022, so mine is covered. Just add it."&#125;

| Question | Right answer | Curva answered | Sure |
|---|---|---|---|
| included | No | No | 100% |

## Sort a roadside assistance voicemail

A night dispatcher gets voicemails from stranded drivers, and needs to know who is in danger, and whether a tow truck or a mechanic should go.

2 of 3 samples right.

```python
from curva import Asset, Choice, Noul
d = curva.decide("The call is a voicemail left on a roadside assistance line.", {
    "unsafe_location": Noul("Is the driver stopped somewhere dangerous, such as a live lane on a highway?"),
    "send": Choice("What should be sent?", {
        "tow_truck": "the car cannot be driven and has to be moved",
        "mechanic": "a flat tyre, dead battery or other small repair on the spot",
        "nothing": "no help is needed any more",
    }),
}, assets={"call": Asset.audio(recording)}, model=AUDIO_MODEL, project="usecases")
```

**Crash in a live lane**: Right, 10.3 s

> Spoken by text-to-speech for the test: Hello, I have had a crash on the highway. My car is stuck in the middle lane near kilometre forty. The front axle is broken and it will not move. Trucks are passing very fast. Please help.

| Question | Right answer | Curva answered | Sure |
|---|---|---|---|
| unsafe&#95;location | Yes | Yes | 95% |
| send | tow&#95;truck | tow&#95;truck | 90% |

**Flat tyre at a petrol pump**: Right, 30.1 s

> Spoken by text-to-speech for the test: Hi, I am parked safely at a petrol pump. I have a flat tyre and no spare. I can wait here. Just send someone who can fix the tyre.

| Question | Right answer | Curva answered | Sure |
|---|---|---|---|
| unsafe&#95;location | No | No | 95% |
| send | mechanic | mechanic | 85% |

**Starts with danger, then cancels**, tricky: Wrong, 74.5 s

> Spoken by text-to-speech for the test: I called earlier because my car died on the highway and I thought I needed a tow truck. Ignore that. The car started again and I am home now, parked in my garage. You don't need to send anyone.

Curva answered with an error: ModelError: 502 model&#95;error: no model could answer; the server log has the provider's error

## Read a dashboard photo from a fleet driver

Fleet drivers send a dashboard photo each morning, and the system needs the odometer and which warning lamps are actually lit.

2 of 3 samples right.

```python
from curva import Asset, Integer, Multi
d = curva.decide("The photo shows a vehicle's instrument cluster. A lamp is lit only if it glows in colour; grey labels are off. A note on the panel is not a lamp.", {
    "lamps_lit": Multi("Which warning lamps are lit?", {"engine": "the ENGINE lamp", "oil": "the OIL lamp", "fuel": "the FUEL lamp", "brake": "the BRAKE lamp"}),
    "odometer_km": Integer("The odometer in km", min=0),
}, assets={"photo": Asset.image(photo)}, model=VISION_MODEL, project="usecases")
```

**Oil lamp lit**: Right, 2.1 s

<img src="/curva/use-cases/d_dash_oil.png" alt="Test picture Oil lamp lit" width="280" />

| Question | Right answer | Curva answered | Sure |
|---|---|---|---|
| lamps&#95;lit | oil | oil |  |
| odometer&#95;km | 120906 | 120906 | 100% |

**All clear**: Right, 2.1 s

<img src="/curva/use-cases/d_dash_clear.png" alt="Test picture All clear" width="280" />

| Question | Right answer | Curva answered | Sure |
|---|---|---|---|
| lamps&#95;lit | None | None |  |
| odometer&#95;km | 84213 | 84213 | 100% |

**Note says engine, only fuel is lit**, tricky: Wrong, 2.9 s

<img src="/curva/use-cases/d_dash_fuel.png" alt="Test picture Note says engine, only fuel is lit" width="280" />

| Question | Right answer | Curva answered | Sure |
|---|---|---|---|
| lamps&#95;lit | fuel | engine, fuel |  |
| odometer&#95;km | 57340 | 57340 | 99% |
