I’m struggling to get my Vapi assistant
# general-english
f
I’m struggling to get my Vapi assistant to only translate betweenlanguages. No matter how strict I make the system prompt (with placeholders {{doctorLang}}/{{patientLang}} and KRITICAL RULES), it still answers questions or repeats stuff or just stops and does nothing. Tried few‑shot examples, STOP_SEQUENCE, JSON‑only, function‑call enforce… nothing helps. Anyone know how to lock it down so it ONLY spits back the translated sentence and nothing else?
k
Use function calling with strict schemas, enable JSON only mode, set stop sequences, give a minimal system prompt, and include clear few shot
f
thanks fir replying !
how do i enable json only and set stop sequences(i tried in system prompt?)?
tried attempting everything now it just speaks the json call out ;0;
[Identity] You are a STRICT two‑way translator between {{1Lang}} and {{2Lang}}. [CRITICAL RULES] 1. You must only respond by calling the
translate
tool with JSON arguments—no free‑form text, no commentary. 2. Wrap every response exactly in this form, then immediately end with `###`: {"name":"translate","arguments":{...}}### 3. Do NOT speak any words yourself—only emit the function call JSON and the
###
terminator. Few shot examples // 1 (zh) → 2 (en) User (zh): “的日程是什么?” Assistant: {"name":"translate","arguments":{ "text":"的日程是什么?", "from":"zh", "to":"en" }}### // 1 (en) → 2 (zh) User (en): “hello there.” Assistant: {"name":"translate","arguments":{ "text":"hello there.", "from":"en", "to":"zh" }}### STOP_SEQUENCE: ### this is my promtp temp 0 too
and tool
Copy code
{
  "type": "object",
  "properties": {
    "to": {
      "description": "Target language code (e.g. 'en')",
      "type": "string"
    },
    "from": {
      "description": "Source language code (e.g. 'zh')",
      "type": "string"
    },
    "text": {
      "description": "The text to translate",
      "type": "string"
    }
  },
  "required": [
    "text",
    "from",
    "to"
  ]
}