ankit-pn's picture
Upload SPEC.md with huggingface_hub
7118cf7 verified
|
Raw History Blame Contribute Delete
6.65 kB
# Phone-assistant function-calling dataset: authoring spec
Tool schemas: `tools.json` (20 functions). Read it before writing.
## Record format (one JSON object per line, JSONL)
```json
{"text": "wake me up at 6:30 tomorrow", "calls": [{"name": "set_alarm", "arguments": {"time": "06:30"}}], "lang": "en"}
{"text": "kal subah 7 baje ka alarm laga do", "calls": [{"name": "set_alarm", "arguments": {"time": "07:00"}}], "lang": "hi-en"}
{"text": "thanks, you're the best", "calls": [], "lang": "en", "reply": "You're welcome! Happy to help."}
```
- `text`: the user's utterance, exactly as a real person would type or say it.
- `calls`: list of function calls. Empty list = the assistant must NOT call any tool.
- `lang`: `"en"` or `"hi-en"` (Hinglish, Hindi in Latin script mixed with English).
- `reply`: only for no-call records. A short, natural assistant reply.
## The sentences MUST be hand-written
No templates, no scripts, no loops, no slot-filling. Write every utterance yourself, the way a real
person talks to Siri or Google Assistant. Vary all of these:
- **Style:** terse ("torch on"), polite ("could you please..."), indirect ("it's so dark in here"),
rambling with filler ("umm hey so can you like..."), all lowercase with no punctuation (voice-typed),
occasional typos ("alram", "remnd"), ALL CAPS rarely, questions vs commands.
- **Content:** different names (Indian and international), cities, apps, songs, times, durations, phrasings.
- **Length:** 2 words up to about 30 words.
- About **15% Hinglish** (`lang: "hi-en"`), e.g. "bhai flashlight on kar", "mummy ko call lagao".
- Never write two records that differ only by a swapped name, number or city. Every sentence must be
structurally different from the others.
## Argument conventions (follow exactly; this is what the grader checks)
- **Optional arguments:** include them only when the user actually expresses them. Never invent values.
- **Times** (`time`): 24-hour `"HH:MM"` with zero padding. "6:30 pm" → `"18:30"`; "noon" → `"12:00"`;
"half past 7 in the evening" → `"19:30"`; "subah 6 baje" → `"06:00"`; "shaam 5 baje" → `"17:00"`.
A bare "7" for a wake-up alarm means `"07:00"`. Avoid utterances where AM/PM is genuinely ambiguous.
- **Dates** (`date`): the date phrase as the user said it, lowercased, without prepositions
("on", "for", "by", "this" stays only if part of meaning, e.g. "this friday").
Examples: "tomorrow", "next monday", "5 october", "day after tomorrow", "this weekend", "friday".
Translate Hinglish dates to English: "kal" → "tomorrow", "parso" → "day after tomorrow",
"somvar" → "monday", "agle hafte" → "next week".
For `get_weather`, omit the date for today/now/currently.
- **Durations:** `set_timer.duration_seconds` is an integer in seconds ("1.5 min" → 90, "an hour" → 3600).
`set_reminder.delay_minutes` is used only for "in N minutes/hours" ("in 2 hours" → 120).
`create_calendar_event.duration_minutes` is included only if a length is stated.
- **Names/contacts/places:** as the user said them, with natural capitalisation ("Rahul", "mom",
"Priya Sharma", "mummy", "Connaught Place"). Do not add titles or words the user didn't say.
- **App names:** proper capitalisation ("WhatsApp", "YouTube", "Google Maps", "Camera", "Settings").
- **Free-text fields** (`message`, `text`, `content`, `query`, `title`, `label`):
- `send_message.message`: the message to send, rewritten from the sender's point of view if needed
("tell mom I'll be late" → `"I'll be late"`). Keep the user's language (Hinglish stays Hinglish).
- `set_reminder.text` / `take_note.content`: the core content without command words
("remind me to buy milk" → `"buy milk"`).
- `web_search.query`: a concise query capturing the question ("who won the ipl final last year" →
`"IPL final winner last year"`). For Hinglish questions write the query in English.
- `play_music.query`: the song/artist/album/genre/playlist/mood only, dropping filler such as
"some", "songs", "music" unless part of a title. Copy the name as the user said it, without
expanding it ("play some arijit songs" → `"arijit"`; "play jazz music" → `"jazz"`).
"play music" / "play something" → no query.
- `create_calendar_event.title`: short title ("lunch with Neha", "dentist appointment").
- `label`: only if the user names the alarm/timer ("pasta timer for 10 min" → label `"pasta"`).
- **set_volume / set_brightness:** exactly one of `level` or `action`. "max/full" → level 100,
"half" → 50, "lowest/zero" → 0 (volume 0 can also be "mute"; use `action: "mute"` if they say mute/silence).
"louder/turn it up" → up. "dim the screen/too bright" → brightness down.
- **cancel_alarm:** include `time` only if the user names which alarm; otherwise `{}`.
- **make_call:** `video: true` only for video calls; otherwise omit `video`.
- **send_message.app:** only if the user names WhatsApp/Telegram/SMS/text message. "text Rahul" alone → omit app.
("text message"/"SMS" → "sms").
- **navigate_to.mode:** only if stated ("walk", "by car", "by metro/bus" → transit, "bike/cycle" → cycling).
- **media_control vs play_music:** "pause / resume / continue / skip / next song / previous / stop the music"
→ media_control. "play <something>" or "play music" → play_music.
- **get_current_datetime vs web_search:** local "what time/day/date is it" → get_current_datetime.
Time in another city, holidays, "when is Diwali" → web_search.
- **get_weather vs web_search:** anything about weather, rain, temperature, umbrella or jacket needs → get_weather.
- **set_alarm vs set_reminder vs set_timer:** "wake me up / alarm" → alarm; "remind me to X" → reminder;
countdown "in N minutes tell me / timer" → timer if there is no task text, reminder if there is a task
("remind me in 10 min to turn off the stove" → set_reminder with text + delay_minutes 10).
- **Parallel calls:** list calls in the order they are mentioned. Only independent actions (no call
that needs another call's result).
## No-call records (`calls: []`)
Small talk, thanks, greetings, feelings, opinions, jokes, and requests the 20 tools cannot do
(take a screenshot, airplane mode, hotspot, book a cab, order food, pay someone, change wallpaper,
take a selfie, set do-not-disturb, read my emails, uninstall an app, translate, calculate a tip, etc.).
Factual questions are NOT no-call; they go to web_search. Give a short natural `reply`. For unsupported
actions, politely say you can't do that yet.
## Self-check
Run `python3 validate.py <your_file.jsonl>` and fix all errors before finishing.