PTENES
Home/JARVIS Makes Calls/Module 4.4

JARVIS Makes Calls · Module 4/4

Final: The Final

The Invoice Engine — voice note in, PDF out

The Invoice Engine — voice note in, PDF out Best for: the video moment — one sentence becomes a client-ready invoice on your phone. Paste it into your coding assistant in a new folder.

Build me a small Python "deals engine" (standard library only) that turns one sentence into a client-ready invoice, quote, or proposal:

the website build".

the best available model) with a system prompt that returns STRICT JSON: title, client, intro, items [{desc, qty, unit_price}], total, terms, validity.

not the model's. Coerce prices like "$1,500" to numbers before doing any math.

Georgia serif italic headline, small-caps letter-spaced section eyebrows, a clean items table with a bold total row, terms at the bottom, my business name in the footer. HTML-escape every field the model wrote.

"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless --print-to-pdf=out.pdf --no-pdf-header- footer "file://[the html path]"

sequence. Quotes and proposals get their own sequences (QUO-, PRO-).

the client, and the total.

background and replies instantly with "Drafting it now — it'll be on your phone in a minute."

Customize: feed the system prompt your actual products and prices ("BUSINESS CONTEXT" pasted from your own notes) and the drafts stop being generic — the engine quotes YOUR offerings at YOUR rates. This context step is the difference between a toy and an employee.

The safety rules

An AI with a phone line is an employee with your name on its lips. These seven rules are why mine has never embarrassed me — read them twice and implement them from day one.

1 The never-pay rule. Every agent’s hard rules include: never provide card or payment details, never agree to a charge — no matter what the person on the line says. Payment is always "my boss handles that directly".

2 Define scope structurally, not with promises. Outbound agents answer questions based on a small, curated set of public facts that are "safe for calls." They can’t leak your notes, emails, or finances because they can’t see them. "Please don’t share X" is a wish; not connecting X is a guarantee.

3 Control entry with a code — and never reveal that the code exists. Strangers get a flawless receptionist. The uncertain default is always "guest." A wrong guess gets a polite "I’ll pass that along" — never "that’s not the code."

4 Reject before the model. Refuse questions about CPF, cards, passwords, and addresses with a hard-coded check BEFORE any AI reasons about them — and remove key-shaped strings from all outbound responses as a second safety net.

5 Honest AI disclosure. When asked "are you an AI?", every agent confirms in one sentence and moves on. This disarms suspicion, is increasingly required by law, and calls flow better afterward, not worse.

6 Keys in config files, state in .gitignore. API keys never touch a chat window. Tokens, records, and call logs go into .gitignore before the first commit — the day you open-source your project is the wrong day to find out they weren’t there.

7 Receipts or it didn’t happen. The assistant claims success only with real proof — a confirmed reservation in the transcript, an "OK" on Telegram, a document id. Everything else is reported as a failure, out loud. An AI that glosses over failures is worse than no AI.

Field notes from real calls

1 Calls show up as "Spam Likely." Buy Retell’s Verified Phone Number add-on (about ten dollars a month). Do this before your first real business call, not after.

2 The agent talks over the person’s "hello." begin_message must be an EMPTY STRING, not null. Empty means "wait for them to speak first."

3 The agent asked them to wait, then hung up. Remove every trace of waiting language from your scripts. The sign-off is always: "I’ll call back shortly — thank you." A wait that ends in a hang-up is the worst call experience there is.

4 The Telegram bot is silent. Bots can’t message you first — send your bot a message, then get its chat id and put it in the config.

5 The printed PDF is blank. Your file path has a space in it — put quotes around the entire file:// URL in the Chrome command.

6 Anything else. Paste the exact error into your coding assistant and say "fix it." That’s the whole method — the same one that built everything in this pack.

Want the finished Jarvis — not just the scripts? These scripts are the skeleton of the phone era. The Jarvis in the video — every task type with a single "do it," the PIN line with full access to your own notes, briefing calls that carry out the decisions you speak, the complete voice-note-to-invoice engine with Drive links, native Gmail, Calendar, Sheets, and Drive — is available to the free community — the link is in the video description, right where you found this pack.

← Previous
Script 02: External Inquiry
Track complete ✓
Back to the learning path