https://retellai.com/?utm_source=discord&utm_medium=seo logo
Hi, I'm trying to setup live outbound call transcr...
# ❓・ai-evy-support
m
@AI Evy Hi, I'm trying to setup live outbound call transcript and always hitting a wall. I'm trying to use my Relay URL as wss://. It seems I'm not getting a live transcript from retell and see these errors in my call history log: 2025-09-09 14:24:11.592 call_b593fe1751946d249e3d1d92e39 error: Error in parsing LLM websocket message: content_complete not a boolean {"response":""} 2025-09-09 14:24:16.152 call_b593fe1751946d249e3d1d92e39 info: Webhook triggered for call_started 2025-09-09 14:24:16.763 call_b593fe1751946d249e3d1d92e39 error: Error triggering webhook for call_started Axios Error: error code: ERR_BAD_REQUEST, error message: Unsupported protocol wss:
a
Thanks for tagging me @mil_d. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Setup WebSocket Server](https://docs.retellai.com/integrate-llm/setup-websocket-server) [[3] Troubleshooting Guide](https://docs.retellai.com/integrate-llm/troubleshooting) [[4] Issue with websocket connection on secure url with wss](https://discord.com/channels/1186424376300679209/1248670601082835087) ​
### Answer Based on your errors, there are two main issues to address: ## WebSocket Response Format Issue The first error indicates your WebSocket response is missing the
content_complete
field [(1) ]() . According to the LLM WebSocket protocol, your response must include this boolean field . Your response should follow this format:
Copy code
javascript
export interface RetellResponse {
  response_id?: number;
  content: string;
  content_complete: boolean;
  end_call: boolean;
}
[(2) ]() For example:
Copy code
javascript
const res: RetellResponse = {
  response_id: request.response_id,
  content: "I am sorry, can you say that again?",
  content_complete: true,
  end_call: false,
};
ws.send(JSON.stringify(res) ) ;
## WebSocket URL Protocol Issue The second error suggests you're using
wss://
protocol incorrectly. For HTTPS endpoints, you should use
wss://
prefix for secure WebSocket connections, while HTTP endpoints use
ws://
prefix [(3) ]() . Make sure your WebSocket URL format is correct: - Correct Format:
wss://your_domain_name/llm-websocket/
[(2) ]() - Incorrect Format (sometimes) :
wss://your_domain_name/llm-websocket/
with trailing slash issues [(3) ]() ## Additional Troubleshooting Steps 1. **Test with Postman**: Connect to your WebSocket URL endpoint using Postman to verify the connection works 2. **Check URL Format**: Some server setups might not allow a trailing slash in the URL 3. **Verify SSL Setup**: There have been reported issues with secure WebSocket connections where the endpoint works with tools like Postman but fails with Retell AI [(4) ]() Check that your WebSocket server is properly handling the connection and sending correctly formatted responses with all required fields.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
I'm seeing this with my Railway and still not getting Live transcript. Sep 9, 2025, 10:40 AM GET /viewer/call_4b0b9926780e5d509a9f1b87d9f 0 29s requestId: "vNjAyagNTzWXqKiUBT7zVQ" timestamp: "2025-09-09T14:46:15.373850197Z" method: "GET" path: "/viewer/call_4b0b9926780e5d509a9f1b87d9f" host: "voice-relay-production-2c5b.up.railway.app" httpStatus: 0 upstreamProto: "HTTP/1.1" downstreamProto: "HTTP/1.1" responseDetails: "connection upgraded to WebSocket" totalDuration: 29656 upstreamAddress: "http://[fd12:3e47:bcd:0:a000:19:61c9:1348]:8080" clientUa: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36" upstreamRqDuration: 29600 txBytes: 0 rxBytes: 784 srcIp: "208.40.86.13" edgeRegion: "unknown" upstreamErrors: ""
@AI Evy I'm seeing this with my Railway and still not getting Live transcript. Sep 9, 2025, 10:40 AM GET /viewer/call_4b0b9926780e5d509a9f1b87d9f 0 29s requestId: "vNjAyagNTzWXqKiUBT7zVQ" timestamp: "2025-09-09T14:46:15.373850197Z" method: "GET" path: "/viewer/call_4b0b9926780e5d509a9f1b87d9f" host: "voice-relay-production-2c5b.up.railway.app" httpStatus: 0 upstreamProto: "HTTP/1.1" downstreamProto: "HTTP/1.1" responseDetails: "connection upgraded to WebSocket" totalDuration: 29656 upstreamAddress: "http://[fd12:3e47:bcd:0:a000:19:61c9:1348]:8080/" clientUa: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36" upstreamRqDuration: 29600 txBytes: 0 rxBytes: 784 srcIp: "208.40.86.13" edgeRegion: "unknown" upstreamErrors: ""
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Setup WebSocket Server](https://docs.retellai.com/integrate-llm/setup-websocket-server) [[3] Unable to get websocket audio and transcript working](https://discord.com/channels/1186424376300679209/1244056873997434961) ​
### Answer Based on your Railway logs showing successful WebSocket connection upgrade but no live transcript, there are several potential issues to check: ## WebSocket Endpoint Path Issue Your Railway log shows the path
/viewer/call_4b0b9926780e5d509a9f1b87d9f
, but according to the Retell AI WebSocket protocol, the correct endpoint format should be
{your-server-websocket-endpoint}/{call_id}
[(1) ]() . For your setup, this should be something like:
Copy code
wss://voice-relay-production-2c5b.up.railway.app/llm-websocket/{call_id}
[(2) ]() ## Required WebSocket Message Flow The connection requires your server to send the first message after the WebSocket connection is established [(1) ]() . Your server should send an initial response event:
Copy code
javascript
ws.on("connection", async (ws: WebSocket, req: Request) => {
  // Send first message - empty response to let user speak first
  const res: RetellResponse = {
    response_id: 0,
    content: "",
    content_complete: true,
    end_call: false,
  };
  ws.send(JSON.stringify(res) ) ;
}) ;
[(2) ]() ## Live Transcript Access For phone calls, live transcripts are only accessible through the custom LLM WebSocket implementation [(3) ]() . The transcript data comes through the WebSocket messages that Retell sends to your server in the
update_only
and
response_required
events [(1) ]() . ## Debugging Steps 1. Verify WebSocket endpoint path - Ensure your agent configuration points to
/llm-websocket/{call_id}
not
/viewer/{call_id}
2. Check initial message - Your server must send the first WebSocket message after connection 3. Monitor WebSocket messages - Log incoming messages to see if you're receiving transcript data from Retell The successful connection upgrade indicates Railway is working correctly, but the endpoint path suggests a configuration mismatch with the expected Retell AI WebSocket protocol.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy Here is my code for Transcript window could you please review it and suggest possible issues I face on back end
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer I don't see your code in your message. Could you please share the code for your transcript window so I can review it against the Retell AI WebSocket protocol requirements? Based on our previous discussion, here are the key backend requirements your WebSocket server must implement for live transcripts [(1) ]() [(2) ]() : ## Required WebSocket Message Handling Your server needs to handle these specific message types [(2) ]() :
Copy code
javascript
ws.on("message", async (data: RawData, isBinary: boolean) => {
  const request: RetellRequest = JSON.parse(data.toString() ) ;
  
  if (request.interaction_type === "update_only") {
    // Process live transcript update
    console.log("Live transcript:", request.transcript) ;
    return;
  }
  
  if (request.interaction_type === "response_required") {
    // Send response back to Retell
    const res: RetellResponse = {
      response_id: request.response_id,
      content: "Your response here",
      content_complete: true,
      end_call: false,
    };
    ws.send(JSON.stringify(res) ) ;
  }
}) ;
[(1) ]() ## Initial Connection Message Your server must send the first message when the WebSocket connection opens [(1) ]() [(2) ]() :
Copy code
javascript
ws.on("connection", async (ws: WebSocket, req: Request) => {
  // Send begin message
  const res: RetellResponse = {
    response_id: 0,
    content: "",
    content_complete: true,
    end_call: false,
  };
  ws.send(JSON.stringify(res) ) ;
}) ;
[(1) ]() Please share your actual code so I can identify specific issues with your implementation.
​ To learn more, see the sources I considered: [[1] Setup WebSocket Server](https://docs.retellai.com/integrate-llm/setup-websocket-server) [[2] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​
### Answer I'd be happy to review your transcript window code, but I don't see the actual code in your message. Could you please share your backend code so I can identify potential issues? Based on your previous messages about live transcript issues, here are the key requirements your backend code should meet according to the LLM WebSocket protocol [(1) ]() : ## Required WebSocket Event Flow Your server needs to handle the connection and send the initial response :
Copy code
javascript
// Initial connection setup - send first message
const initialResponse = {
  response_type: "response",
  response_id: 0,
  content: "",
  content_complete: true,
  end_call: false
};
## Handling Incoming Messages Your server should process these event types from Retell : -
update_only
- Contains live transcript data -
response_required
- Requires your server to respond -
reminder_required
- Reminder requests The transcript data comes in the
transcript
field of these events . ## Response Format Every response must include the required fields :
Copy code
javascript
{
  response_type: "response",
  response_id: <matching_request_id>,
  content: "your response text",
  content_complete: true,
  end_call: false
}
Please share your actual backend code so I can identify specific issues with your implementation. The path
/viewer/call_id
from your Railway logs suggests the WebSocket endpoint might not be configured correctly for the LLM WebSocket protocol.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer I don't see the actual code in your message. Could you please share your transcript window code so I can review it for you? Once you share the code, I can compare it against the Retell AI WebSocket protocol requirements and identify potential issues. Based on your previous messages, here are the key areas I'll check: ## WebSocket Endpoint Configuration Your endpoint should follow this format [(1) ]() :
Copy code
javascript
app.ws("/llm-websocket/:call_id",
  async (ws: WebSocket, req: Request) => {
    const callId = req.params.call_id;
    // Your WebSocket handling code here
  }
) ;
[(2) ]() ## Required Message Flow Your server must send the first message after connection :
Copy code
javascript
// Send Begin message
const res: RetellResponse = {
  response_id: 0,
  content: "How may I help you?",
  content_complete: true,
  end_call: false,
};
ws.send(JSON.stringify(res) ) ;
## Handling Incoming Messages Your server needs to process different interaction types [(1) ]() :
Copy code
javascript
ws.on("message", async (data: RawData, isBinary: boolean) => {
  const request: RetellRequest = JSON.parse(data.toString() ) ;
  
  if (request.interaction_type === "update_only") {
    // Process live transcript update
    return;
  }
  
  if (request.interaction_type === "response_required") {
    // Send response back
  }
}) ;
[(2) ]() Please share your code so I can identify the specific issues causing your live transcript problems.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Setup WebSocket Server](https://docs.retellai.com/integrate-llm/setup-websocket-server) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy Ill be sending it in 4 messages, here is 1/4 : import express from "express"; import http from "http"; import cors from "cors"; import morgan from "morgan"; import { WebSocketServer, WebSocket } from "ws"; const app = express(); app.use(cors()); app.use(express.json({ limit: "1mb" })); app.use(morgan("tiny")); const server = http.createServer(app); // ---------------- In-memory rooms ---------------- /** rooms: callId -> { transcript: Array"user", content:string, ts:number}, viewers:Set } */ const rooms = new Map(); function getRoom(id) { if (!rooms.has(id)) rooms.set(id, { transcript: [], viewers: new Set() }); return rooms.get(id); } // Broadcast helpers (use WebSocket.OPEN) function sendSnapshot(callId) { const room = rooms.get(callId); if (!room) return; const data = JSON.stringify({ type: "snapshot", items: room.transcript }); for (const ws of room.viewers) if (ws.readyState === WebSocket.OPEN) ws.send(data); } function sendUpdate(callId, item) { const room = rooms.get(callId); if (!room) return; const data = JSON.stringify({ type: "update", item }); for (const ws of room.viewers) if (ws.readyState === WebSocket.OPEN) ws.send(data); } // Merge Retell's trimmed update_only transcript (last few utterances) into our full transcript function mergeTrimmed(room, segs) { for (const seg of segs) { const role = seg.role === "customer" ? "user" : (seg.role || "agent"); const text = (seg.content || "").trim(); if (!text) continue; const list = room.transcript; const last = list[list.length - 1];
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer Based on your first part of the code, I can already see some potential issues. Please share the remaining 3 parts so I can provide a complete review, but here are initial observations: ## Missing LLM WebSocket Endpoint Your code shows a general WebSocket setup, but I don't see the required LLM WebSocket endpoint that Retell AI expects [(1) ]() . You need this specific endpoint structure [(2) ]() :
Copy code
javascript
app.ws("/llm-websocket/:call_id",
  async (ws: WebSocket, req: Request) => {
    // callId is a unique identifier of a call, containing all information about it
    const callId = req.params.call_id;
    // You need to send the first message here, but for now let's skip that.
    ws.on("error", (err) => {
      console.error("Error received in LLM websocket client: ", err) ;
    }) ;
    ws.on("message", async (data: RawData, isBinary: boolean) => {
      // Retell server will send transcript from caller along with other information
      // You will be adding code to process and respond here
      console.log(data) ;
    }) ;
  },
) ;
## Required Response Format Your code needs to handle Retell's specific message protocol [(1) ]() . When Retell sends messages to your server, you must respond with this format [(2) ]() :
Copy code
javascript
export interface RetellResponse {
  response_id?: number;
  content: string;
  content_complete: boolean;
  end_call: boolean;
}
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Setup WebSocket Server](https://docs.retellai.com/integrate-llm/setup-websocket-server) ​
## Initial Message Requirement Your server must send the first message after connection establishment [(1) ]() . This is critical for the protocol to work properly [(2) ]() . Please share the remaining parts of your code so I can identify other specific issues with your WebSocket message handling and response logic.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy Here is 2/4: if (last && last.role === role) { // Same speaker: extend last line if new text grows from it if (text.startsWith(last.content)) last.content = text; else if (!last.content.startsWith(text) && last.content !== text) list.push({ role, content: text, ts: Date.now() }); } else { // New speaker: avoid immediate dupes const recentDup = list.slice(-4).some(it => it.role === role && it.content === text); if (!recentDup) list.push({ role, content: text, ts: Date.now() }); } } } // ---------------- Viewer WS (extension transcript window) ---------------- const viewerWss = new WebSocketServer({ noServer: true }); viewerWss.on("connection", (ws, req) => { const u = new URL(req.url, "http://x"); const cleanPath = (u.pathname || "").replace(/\/+$/, ""); const callId = cleanPath.split("/").filter(Boolean)[1] || u.searchParams.get("callId") || ""; if (!callId) return ws.close(); const room = getRoom(callId); room.viewers.add(ws); // Initial snapshot ws.send(JSON.stringify({ type: "snapshot", items: room.transcript })); ws.on("close", () => room.viewers.delete(ws)); });
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] Setup WebSocket Server](https://docs.retellai.com/integrate-llm/setup-websocket-server) [[2] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​
Copy code
javascript
export interface RetellResponse {
 response_id?: number;
 content: string;
 content_complete: boolean;
 end_call: boolean;
}
Please share parts 3/4 and 4/4 so I can see if you have the LLM WebSocket endpoint implementation. The viewer WebSocket is good for displaying transcripts, but you need the LLM WebSocket to receive live transcript data from Retell AI.
### Answer ### Answer Thanks for sharing part 2/4. I can see more issues now. Your viewer WebSocket is set up, but you're still missing the critical LLM WebSocket endpoint that Retell AI requires for live transcripts [(1) ]() [(2) ]() . ## Missing LLM WebSocket Endpoint Your current code only has a viewer WebSocket, but you need the specific
/llm-websocket/:call_id
endpoint that Retell AI connects to [(1) ]() :
Copy code
javascript
app.ws("/llm-websocket/:call_id",
 async (ws: WebSocket, req: Request) => {
 // callId is a unique identifier of a call, containing all information about it
 const callId = req.params.call_id;
 // You need to send the first message here, but for now let's skip that.
 ws.on("error", (err) => {
 console.error("Error received in LLM websocket client: ", err) ;
 }) ;
 ws.on("message", async (data: RawData, isBinary: boolean) => {
 // Retell server will send transcript from caller along with other information
 // You will be adding code to process and respond here
 console.log(data) ;
 }) ;
 },
) ;
## Protocol Mismatch Your viewer WebSocket expects messages like
{ type: "snapshot", items: [...] }
, but Retell AI sends messages following the LLM WebSocket protocol [(2) ]() : -
interaction_type: "update_only"
- contains live transcript data -
interaction_type: "response_required"
- requires your server to respond -
interaction_type: "reminder_required"
- reminder requests ## Required Response Format When Retell sends messages to your LLM WebSocket endpoint, you must respond with this exact format [(1) ]() :
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy 3/4 // Keep viewers alive setInterval(() => { for (const { viewers } of rooms.values()) { for (const ws of viewers) if (ws.readyState === WebSocket.OPEN) { try { ws.ping(); } catch {} } } }, 15000); // ---------------- LLM WS (Retell Custom LLM) ---------------- const llmWss = new WebSocketServer({ noServer: true }); const BRAIN = (process.env.BRAIN || "minimal").toLowerCase(); // "minimal" | "off" // tiny placeholder replies to keep call flowing; replace with your logic later function minimalBrainReply(transcript) { const lastUser = [...transcript].reverse().find(t => t.role === "user"); const q = (lastUser?.content || "").toLowerCase(); if (/rate|pay|how much|price/.test(q)) return "What’s your best rate on this load?"; if (/ready|pickup|when|time|today|tomorrow|now/.test(q)) return "What’s the pickup and delivery window?"; if (/weight|pound|lbs|pallet/.test(q)) return "What’s the weight and commodity?"; if (/appt|appointment|first come/.test(q)) return "Is this first-come first-served or by appointment?"; if (/yes|ok|available|have/.test(q)) return "Great—can you share the full load details?"; return "Could you share the pickup city, delivery city, weight, and your best rate?"; } llmWss.on("connection", (ws, req) => { const u = new URL(req.url, "http://x"); const cleanPath = (u.pathname || "").replace(/\/+$/, ""); const parts = cleanPath.split("/").filter(Boolean); // e.g. ["llm",""] or ["llm-websocket",""] const isLlm = parts[0] === "llm" || parts[0] === "llm-websocket";
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer ### Answer Good! I can see you have the LLM WebSocket server setup starting. Based on part 3/4, you're on the right track but there are still some critical implementation issues. Please share part 4/4 to see the complete message handling, but here are the key issues I can identify: ## Missing Required Initial Message Your LLM WebSocket connection handler needs to send the first message immediately after connection [(1) ]() . This is required by the protocol [(2) ]() :
Copy code
javascript
llmWss.on("connection", (ws, req) => {
  // ... your existing code ...
  
  // Send Begin message immediately after connection
  const res = {
    response_id: 0,
    content: "How may I help you?",
    content_complete: true,
    end_call: false,
  };
  ws.send(JSON.stringify(res) ) ;
}) ;
[(1) ]() ## Protocol Message Handling Your server must handle Retell's specific message format [(2) ]() . You need to process these
interaction_type
values:
Copy code
javascript
ws.on("message", async (data, isBinary) => {
  if (isBinary) {
    console.error("Got binary message instead of text in websocket.") ;
    ws.close(1002, "Cannot find corresponding Retell LLM.") ;
  }
  try {
    const request = JSON.parse(data.toString() ) ;
    
    if (request.interaction_type === "update_only") {
      // Process live transcript update - this is where you get live transcripts
      mergeTrimmed(getRoom(callId) , request.transcript) ;
      sendSnapshot(callId) ;
      return;
    }
    
    if (request.interaction_type === "response_required") {
      // Send response back to Retell
      const response = {
        response_id: request.response_id,
        content: minimalBrainReply(request.transcript) ,
        content_complete: true,
        end_call: false,
      };
      ws.send(JSON.stringify(response) ) ;
    }
  } catch (err) {
    console.error("Error in parsing LLM websocket message: ", err) ;
    ws.close(1002, "Cannot parse incoming message.") ;
  }
}) ;
[(1) ]() ## Endpoint Path Issue Your Railway logs showed
/viewer/call_id
but the LLM WebSocket should be
/llm-websocket/{call_id}
[(2) ]() . Make sure your agent configuration points to the correct endpoint. Please share part 4/4 so I can see your complete message handling implementation.
​ To learn more, see the sources I considered: [[1] Setup WebSocket Server](https://docs.retellai.com/integrate-llm/setup-websocket-server) [[2] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy here is part 4 but I have more to send: let callId = (isLlm && parts[1]) || u.searchParams.get("call_id") || u.searchParams.get("callId") || ""; let room = callId ? getRoom(callId) : null; console.log(
[llm] WS connected path=${cleanPath} callId=${callId || "(pending)"}
); // Send CONFIG (so Retell streams call details + pings) try { ws.send(JSON.stringify({ response_type: "config", config: { call_details: true, auto_reconnect: true } })); } catch {} // Per your note: send an initial empty response so the user/broker can speak first try { ws.send(JSON.stringify({ response_id: 0, content: "", content_complete: true, end_call: false })); } catch {} ws.on("message", (buf) => { let msg; try { msg = JSON.parse(buf.toString()); } catch { return; } // Learn callId from call_details if not provided in URL if (!callId && msg?.call_details?.call_id) { callId = msg.call_details.call_id; room = getRoom(callId); console.log(
[llm] learned callId from call_details: ${callId}
); } if (!room) return; if (msg.interaction_type === "update_only" && Array.isArray(msg.transcript)) { // Live updates — merge trimmed segments and snapshot viewers mergeTrimmed(room, msg.transcript); sendSnapshot(callId); return;
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
Thanks for the follow-up, @mil_d. I'll get back to you soon.
m
@AI Evy And 2 more: } if (msg.interaction_type === "response_required") { const reply = BRAIN === "off" ? "" : minimalBrainReply(room.transcript); ws.send(JSON.stringify({ response_id: msg.response_id, content: reply, content_complete: true, end_call: false })); return; } if (msg.interaction_type === "reminder_required") { ws.send(JSON.stringify({ response_id: msg.response_id, content: "", content_complete: true, end_call: false })); return; } }); }); // ---------------- Optional HTTP utilities ---------------- app.get("/health", (_req, res) => res.status(200).send("ok")); app.all("/noop", (_req, res) => res.status(200).json({ ok: true })); app.get("/state/:callId", (req, res) => res.json({ items: rooms.get(req.params.callId)?.transcript || [] })); // Optional POST ingest for manual chunks (guarded by RELAY_TOKEN) const RELAY_TOKEN = process.env.RELAY_TOKEN || ""; app.post(["/ingest", "/chunk", "/llm-http"], (req, res) => { if (RELAY_TOKEN) { const tok = req.get("X-Relay-Token") || req.get("Authorization")?.replace(/^Bearer\s+/i, ""); if (tok !== RELAY_TOKEN) return res.status(401).json({ error: "bad token" }); } const { call_id, callId, text, speaker, role, ts } = req.body || {}; const id = call_id || callId; const msg = (text ?? "").toString().trim(); if (!id || !msg) return res.status(400).json({ error: "call_id and text required" });
a
## Endpoint Path Configuration Based on your Railway logs showing
/viewer/call_id
, make sure your agent's
llm_websocket_url
is configured to point to
/llm-websocket/{call_id}
or
/llm/{call_id}
(based on your path parsing) [(1) ]() [(2) ]() . ## Auto-Reconnect Implementation Since you're using
auto_reconnect: true
, you should also handle ping-pong events [(2) ]() :
Copy code
javascript
if (msg.interaction_type === "ping_pong") {
  ws.send(JSON.stringify({
    response_type: "ping_pong",
    timestamp: msg.timestamp
  }) ) ;
  return;
}
Please share the rest of your code so I can see your complete
response_required
handling implementation.
​ To learn more, see the sources I considered: [[1] Setup WebSocket Server](https://docs.retellai.com/integrate-llm/setup-websocket-server) [[2] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​
### Answer Your code is looking much better now! I can see you're correctly implementing the LLM WebSocket protocol [(1) ]() [(2) ]() . However, there are a few key issues that could be causing your live transcript problems: ## Config Event Response Type Issue Your config message is missing the required
response_type
field [(2) ]() . The correct format should be:
Copy code
javascript
ws.send(JSON.stringify({ 
  response_type: "config", 
  config: { 
    call_details: true, 
    auto_reconnect: true 
  } 
}) ) ;
## Initial Response Format Your initial response looks correct, but make sure it follows the exact protocol [(1) ]() [(2) ]() :
Copy code
javascript
ws.send(JSON.stringify({ 
  response_id: 0, 
  content: "", 
  content_complete: true, 
  end_call: false 
}) ) ;
[(1) ]() ## Missing Response Event Type When you handle
response_required
and
reminder_required
events, your responses need the
response_type
field [(2) ]() . You should respond with:
Copy code
javascript
const res = {
  response_type: "response",
  response_id: request.response_id,
  content: "Your response here",
  content_complete: true,
  end_call: false,
};
ws.send(JSON.stringify(res) ) ;
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @mil_d. I'll get back to you soon.
m
@AI Evy Should be last one: const normRole = /cust|user/i.test((speaker || role || "agent")) ? "user" : "agent"; const room = getRoom(id); const item = { role: normRole, content: msg, ts: Number(ts) || Date.now() }; room.transcript.push(item); sendUpdate(id, item); res.json({ ok: true }); }); // ---------------- WS Upgrade router + token guard ---------------- server.on("upgrade", (req, socket, head) => { try { const u = new URL(req.url, "http://x"); const cleanPath = (u.pathname || "").replace(/\/+$/, ""); // tolerate trailing slash const tok = u.searchParams.get("token") || ""; const isViewer = cleanPath.startsWith("/viewer"); const isLlm = cleanPath.startsWith("/llm") || cleanPath.startsWith("/llm-websocket"); const need = isLlm ? process.env.LLM_TOKEN : isViewer ? process.env.VIEWER_TOKEN : null; if (need && tok !== need) { socket.write("HTTP/1.1 401 Unauthorized\r\n\r\n"); socket.destroy(); return; } if (isViewer) { viewerWss.handleUpgrade(req, socket, head, (ws) => viewerWss.emit("connection", ws, req)); } else if (isLlm) { llmWss.handleUpgrade(req, socket, head, (ws) => llmWss.emit("connection", ws, req)); } else { socket.destroy(); } } catch { socket.destroy(); } }); // ---------------- Start ---------------- const PORT = process.env.PORT || 8080; server.listen(PORT, "0.0.0.0", () => console.log(
[relay] listening on ${PORT}
));
a
### Answer ### Answer Your code looks mostly correct! I can see you have the proper LLM WebSocket implementation with the right message handling. However, there are a few key issues that could be causing your live transcript problems: ## Response Format Issue Your response format is missing the
response_type
field [(1) ]() . According to the LLM WebSocket protocol, your responses should include this field :
Copy code
javascript
// Your current format:
ws.send(JSON.stringify({
  response_id: msg.response_id,
  content: reply,
  content_complete: true,
  end_call: false
}) ) ;

// Should be:
ws.send(JSON.stringify({
  response_type: "response",
  response_id: msg.response_id,
  content: reply,
  content_complete: true,
  end_call: false
}) ) ;
## Initial Message Format Your initial message also needs the
response_type
field :
Copy code
javascript
// Your current format:
ws.send(JSON.stringify({ response_id: 0, content: "", content_complete: true, end_call: false }) ) ;

// Should be:
ws.send(JSON.stringify({
  response_type: "response",
  response_id: 0,
  content: "",
  content_complete: true,
  end_call: false
}) ) ;
## WebSocket Server Upgrade Issue You're using a separate WebSocketServer with
noServer: true
, but you need to properly handle the HTTP upgrade for the LLM WebSocket endpoint [(2) ]() . The typical approach is to use express-ws or handle the upgrade manually:
Copy code
javascript
app.ws("/llm-websocket/:call_id",
  async (ws: WebSocket, req: Request) => {
    const callId = req.params.call_id;
    // Your WebSocket handling code here
  }
) ;
## Agent Configuration Make sure your Retell AI agent is configured to use the correct WebSocket URL format:
wss://voice-relay-production-2c5b.up.railway.app/llm-websocket/
The path
/viewer/call_id
in your Railway logs suggests the agent might be connecting to the wrong endpoint. Your LLM WebSocket should be accessible at
/llm-websocket/{call_id}
[(1) ]() . Please share the final part of your code so I can see how you handle the HTTP server upgrade for WebSocket connections.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Setup WebSocket Server](https://docs.retellai.com/integrate-llm/setup-websocket-server) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer ## Complete Code Review - Issues Found Your code is well-structured but has several critical issues that are preventing live transcripts from working properly with Retell AI's protocol. ## Critical Issue 1: Missing Response Type in LLM Responses Your response messages are missing the required
response_type
field [(1) ]() . When handling
response_required
and
reminder_required
events, you must include
response_type: "response"
:
Copy code
javascript
if (msg.interaction_type === "response_required") {
  const reply = BRAIN === "off" ? "" : minimalBrainReply(room.transcript) ;
  ws.send(JSON.stringify({
    response_type: "response",  // <- This is missing in your code
    response_id: msg.response_id,
    content: reply,
    content_complete: true,
    end_call: false
  }) ) ;
  return;
}
## Critical Issue 2: Missing Ping-Pong Handling Since you're using
auto_reconnect: true
, you must handle ping-pong events . Add this to your message handler:
Copy code
javascript
if (msg.interaction_type === "ping_pong") {
  ws.send(JSON.stringify({
    response_type: "ping_pong",
    timestamp: msg.timestamp
  }) ) ;
  return;
}
This matches the issue reported in the Discord community where users don't receive ping-pong events when auto_reconnect is enabled [(2) ]() . ## Issue 3: Initial Response Missing Response Type Your initial response should also include
response_type
[(1) ]() :
Copy code
javascript
// Per your note: send an initial empty response so the user/broker can speak first
try {
  ws.send(JSON.stringify({ 
    response_type: "response",  // <- Add this
    response_id: 0, 
    content: "", 
    content_complete: true, 
    end_call: false 
  }) ) ;
} catch {}
[(3) ]() ## Issue 4: Content Complete Boolean Error The error in your logs shows
content_complete not a boolean {"response":""}
[(1) ]() . This suggests you're sending an incorrect response format somewhere. Make sure all responses follow the exact format :
Copy code
javascript
{
  response_type: "response",
  response_id: request.response_id,
  content: "your response text",
  content_complete: true,
  end_call: false
}
## Issue 5: Endpoint Configuration Your Railway logs show
/viewer/call_id
but your LLM WebSocket should use
/llm-websocket/{call_id}
. Make sure your agent's
llm_websocket_url
points to the correct endpoint format [(3) ]() . ## Recommended Fixes 1. Add
response_type: "response"
to all your response messages [(1) ]() 2. Implement ping-pong handling for auto-reconnect 3. Add
response_type: "response"
to your initial message [(3) ]() 4. Verify your agent configuration uses the correct WebSocket URL format [(1) ]() These changes should resolve your live transcript issues and the parsing errors you're seeing in the call logs.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Disconnection_reason:
error_llm_websocket_runtime
](https://discord.com/channels/1186424376300679209/1298564756504055852) [[3] Setup WebSocket Server](https://docs.retellai.com/integrate-llm/setup-websocket-server) ​
m
@AI Evy After all these edits I'm getting this in my call log: 2025-09-09 15:18:28.014 call_268a7acbe4ae21e6df52107543e info: Starting call: call_268a7acbe4ae21e6df52107543e 2025-09-09 15:18:28.021 call_268a7acbe4ae21e6df52107543e info: LLM Ws init attempt 0 2025-09-09 15:18:28.275 call_268a7acbe4ae21e6df52107543e info: LLM ws open: 2025-09-09 15:18:28.278 call_268a7acbe4ae21e6df52107543e error: Error in parsing LLM websocket message: content_complete not a boolean {"response":""} 2025-09-09 15:18:35.889 call_268a7acbe4ae21e6df52107543e info: Webhook triggered for call_started 2025-09-09 15:18:36.584 call_268a7acbe4ae21e6df52107543e error: Error triggering webhook for call_started Axios Error: error code: ERR_BAD_REQUEST, error message: Unsupported protocol wss: 2025-09-09 15:18:42.242 call_268a7acbe4ae21e6df52107543e verbose: Sending updates (transcript trimmed to last 2 utterances): { transcript: [ { role: 'user', content: 'And trying', words: [Array] } ], interaction_type: 'update_only' } 2025-09-09 15:18:42.242 call_268a7acbe4ae21e6df52107543e verbose: Sending updates (transcript trimmed to last 2 utterances): { transcript: [ { role: 'user', content: 'And trying', words: [Array] } ], interaction_type: 'update_only', turntaking: 'user_turn' } 2025-09-09 15:18:43.129 call_268a7acbe4ae21e6df52107543e verbose: Sending updates (transcript trimmed to last 2 utterances): { transcript: [ { role: 'user', content: "I'm trying to see if I'm gonna", words: [Array] } ], interaction_type: 'update_only' } 2025-09-09 15:18:44.139 call_268a7acbe4ae21e6df52107543e verbose: Sending updates (transcript trimmed to last 2 utterances): {
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer ### Answer Good news! Your live transcripts are now working - I can see Retell is successfully sending
update_only
events with transcript data [(1) ]() . The remaining error is in your initial message format. ## Fix the Initial Message Format The error
content_complete not a boolean {"response":""}
shows you're still sending an incorrect initial message format . Based on the LLM WebSocket protocol, your initial message should be [(2) ]() :
Copy code
javascript
// Send Begin message immediately after connection
const res = {
  response_id: 0,
  content: "",
  content_complete: true,
  end_call: false,
};
ws.send(JSON.stringify(res) ) ;
Make sure you're not sending
{"response":""}
anywhere in your code. The correct initial response format must include all required fields [(1) ]() . ## Webhook Protocol Error The webhook error
Unsupported protocol wss:
suggests you have a webhook URL configured with
wss://
protocol [(3) ]() . Webhooks should use ` not
wss://
since they're HTTP POST requests, not WebSocket connections . ## Your Live Transcripts Are Working The good news is your live transcript functionality is now working correctly! The logs show Retell is successfully sending you: -
interaction_type: 'update_only'
events with transcript data [(1) ]() -
turntaking: 'user_turn'
events - Live transcript updates with user speech content Your
mergeTrimmed()
function should be receiving these updates and broadcasting them to your viewer WebSocket clients. ## Summary 1. Fix your initial message to use the exact format from the documentation [(2) ]() 2. Change any webhook URLs from
wss://
to ` [(3) ]() 3. Your live transcripts are already working - you should see the data flowing to your viewer clients
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Setup WebSocket Server](https://docs.retellai.com/integrate-llm/setup-websocket-server) [[3] Create Web Call](https://docs.retellai.com/api-references/create-web-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy Is it correct Custom LLM URL? https://voice-relay-production-2c5b.up.railway.app//llm-websocket/{call_id}?token=2d28507a249bca712948ef8fc04c5bd9ef6b934f74113d2f74f725b70c7ca87888ceb824e67c09511fa6f99cd7731511
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer Your Custom LLM URL has a few issues that need to be corrected: ## Protocol Issue Your URL uses ` but should use
wss://
for WebSocket connections [(1) ]() . The LLM WebSocket endpoint requires a secure WebSocket protocol . ## Double Slash Issue You have a double slash
//llm-websocket/
which should be a single slash
/llm-websocket/
. ## Correct Format The correct Custom LLM URL format should be :
Copy code
wss://voice-relay-production-2c5b.up.railway.app/llm-websocket/{call_id}?token=2d28507a249bca712948ef8fc04c5bd9ef6b934f74113d2f74f725b70c7ca87888ceb824e67c09511fa6f99cd7731511
## WebSocket Endpoint Specification According to the documentation, the WebSocket endpoint should follow this format : WebSocket Endpoint:
{your-server-websocket-endpoint}/{call_id}
Where
{call_id}
is a unique call identifier . ## Testing Your Endpoint You can test your WebSocket connection using Postman [(2) ]() : 1. Open Postman and create a new WebSocket request 2. Enter your WebSocket URL and click "Connect" 3. Navigate to the "Message" tab, enter "Hello", and click "Send" You should receive the message back in your server indicating a successful connection . Make sure your server is properly handling the WebSocket upgrade for the
/llm-websocket/
path as shown in your code.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Troubleshooting Guide](https://docs.retellai.com/integrate-llm/troubleshooting) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer I don't see the Railway logs you're referring to in your message. Could you share what you're seeing in Railway so I can help diagnose the issue? Based on our conversation, your Custom LLM URL should use the WebSocket protocol format [(1) ]() :
Copy code
wss://voice-relay-production-2c5b.up.railway.app/llm-websocket/{call_id}?token=2d28507a249bca712948ef8fc04c5bd9ef6b934f74113d2f74f725b70c7ca87888ceb824e67c09511fa6f99cd7731511
The WebSocket endpoint specification requires this format [(2) ]() : WebSocket Endpoint:
{your-server-websocket-endpoint}/{call_id}
Where
call_id
is a unique call identifier . If you're still seeing errors, please share the Railway logs so I can help identify what's happening with your WebSocket connection and message handling.
​ To learn more, see the sources I considered: [[1] Setup WebSocket Server](https://docs.retellai.com/integrate-llm/setup-websocket-server) [[2] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy Here you go: Sep 9, 2025, 11:28 AM GET //llm-websocket/{call_id} 404 76ms requestId: "vvPNXubBTHW0B03aCx5-qw" timestamp: "2025-09-09T15:32:21.131498543Z" method: "GET" path: "//llm-websocket/{call_id}" host: "voice-relay-production-2c5b.up.railway.app" httpStatus: 404 upstreamProto: "HTTP/1.1" downstreamProto: "HTTP/1.1" responseDetails: "" totalDuration: 76 upstreamAddress: "http://[fd12:3e47:bcd:0:a000:5c:c2f6:f41]:8080" clientUa: "Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)" upstreamRqDuration: 19 txBytes: 167 rxBytes: 420 srcIp: "35.237.4.214" edgeRegion: "us-east4-eqdc4a" upstreamErrors: "" GET /viewer/call_fe7431ff7e7d3a131a239cba79e 0 11s GET /viewer/call_fe7431ff7e7d3a131a239cba79e 0 1s GET /viewer/call_fe7431ff7e7d3a131a239cba79e 0 1s GET /viewer/call_fe7431ff7e7d3a131a239cba79e 0 1s GET /viewer/call_fe7431ff7e7d3a131a239cba79e 0 1s GET /viewer/call_fe7431ff7e7d3a131a239cba79e 0 1s GET /viewer/call_fe7431ff7e7d3a131a239cba79e 0 1s GET /viewer/call_fe7431ff7e7d3a131a239cba79e 0 869ms GET /viewer/call_50046244a576951202b8d51ed7d 0 26s GET /viewer/call_3993e66652dea88808d113654f6 0 20s
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer ## Found the Issue! Double Slash Problem Your Railway logs show the exact problem - Retell AI is making a GET request to
//llm-websocket/{call_id}
with a double slash, which returns a 404 error [(1) ]() . ## URL Format Issue Your Custom LLM URL has the double slash issue we identified earlier. You configured:
Copy code
<https://voice-relay-production-2c5b.up.railway.app//llm-websocket/%7Bcall_id%7D>
But it should be:
Copy code
wss://voice-relay-production-2c5b.up.railway.app/llm-websocket/{call_id}?token=your_token
## Two Critical Fixes Needed 1. **Remove the double slash**: Change
//llm-websocket/
to
/llm-websocket/
2. **Use WebSocket protocol**: Change ` to
wss://
for WebSocket connections [(2) ]() ## Correct WebSocket Endpoint Format According to the LLM WebSocket documentation, the endpoint should follow this format : WebSocket Endpoint:
{your-server-websocket-endpoint}/{call_id}
Where
call_id
is a unique call identifier . ## Check Your Server Configuration Your server upgrade handler correctly handles both
/llm
and
/llm-websocket
paths, but make sure the trailing slash handling is working properly [(1) ]() :
Copy code
javascript
const cleanPath = (u.pathname || "") .replace(/\/+$/, "") ; // tolerate trailing slash
const isLlm = cleanPath.startsWith("/llm") || cleanPath.startsWith("/llm-websocket") ;
Update your agent's Custom LLM URL to use the correct format with
wss://
protocol and single slash, and the 404 errors should resolve.
​ To learn more, see the sources I considered: [[1] Troubleshooting Guide](https://docs.retellai.com/integrate-llm/troubleshooting) [[2] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy I'm still getting this error 2025-09-09 16:13:18.324 call_3cdb2701ba30128e7ee01ce5cd8 error: Error triggering webhook for call_started Axios Error: error code: ERR_BAD_REQUEST, error message: Unsupported protocol wss:
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer ### Answer ## Webhook Protocol Issue The error
Unsupported protocol wss:
indicates you have a webhook URL configured with the
wss://
protocol [(1) ]() . This is incorrect - webhooks are HTTP POST requests, not WebSocket connections . ## Webhook vs WebSocket URLs You need to configure two different URLs in your Retell AI agent: 1. **Custom LLM WebSocket URL**: Uses
wss://
protocol for live transcripts 2. **Webhook URL**: Uses ` protocol for event notifications ## Fix Your Webhook Configuration Your webhook URL should use ` not
wss://
. Webhooks are HTTP POST requests that Retell AI sends to notify your application about events like
call_started
,
call_ended
, and
call_analyzed
. The webhook will
POST
the payload to your endpoint with a timeout of 10 seconds . If no success status (2xx) is received within 10 seconds, the webhook will be retried up to 3 times . ## Webhook Endpoint Format Your webhook endpoint should be something like:
Copy code
<https://voice-relay-production-2c5b.up.railway.app/webhook>
## Sample Webhook Handler According to the documentation, here's how to handle webhooks properly [(2) ]() :
Copy code
javascript
app.post("/webhook", (req: Request, res: Response) => {
 if (
 !Retell.verify(
 JSON.stringify(req.body) ,
 process.env.RETELL_API_KEY,
 req.headers["x-retell-signature"] as string,
 )
 ) {
 console.error("Invalid signature") ;
 return;
 }
 const {event, call} = req.body;
 // process the webhook
 // Acknowledge the receipt of the event
 res.status(204) .send() ;
}) ;
## Summary - **WebSocket URL**:
wss://voice-relay-production-2c5b.up.railway.app/llm-websocket/{call_id}?token=...
(for live transcripts) - **Webhook URL**: ` (for event notifications) [(1) ]() Change your webhook URL from
wss://
to ` to resolve this error.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Secure the webhook](https://docs.retellai.com/features/secure-webhook) ​
m
@AI Evy I now I want to add two buttons to my "live Transcript" window. End call and Transfer call. I'm using custom LLM Agent. How can I do that?
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer For your live transcript window with End Call and Transfer Call buttons using a Custom LLM Agent, you can implement these features through the LLM WebSocket response events [(1) ]() . ## End Call Button To implement an end call button, send a response event with
end_call: true
:
Copy code
javascript
// When user clicks "End Call" button
const endCallResponse = {
  response_type: "response",
  response_id: currentResponseId, // Use the current response_id from Retell
  content: "Thank you for calling. Have a great day!",
  content_complete: true,
  end_call: true
};
ws.send(JSON.stringify(endCallResponse) ) ;
## Transfer Call Button For call transfers with Custom LLM, you can trigger a cold transfer by setting the
transfer_number
field in your response event :
Copy code
javascript
// When user clicks "Transfer Call" button
const transferResponse = {
  response_type: "response", 
  response_id: currentResponseId,
  content: "Let me transfer you to the right department.",
  content_complete: true,
  end_call: false,
  transfer_number: "+1234567890" // The number to transfer to
};
ws.send(JSON.stringify(transferResponse) ) ;
## Implementation in Your Live Transcript Window Based on your existing WebSocket setup, you can add these buttons to your viewer interface and send commands to your LLM WebSocket server:
Copy code
javascript
// In your viewer WebSocket client
function endCall() {
  // Send command to your server to trigger end call
  viewerWs.send(JSON.stringify({
    action: "end_call",
    callId: currentCallId
  }) ) ;
}

function transferCall(transferNumber) {
  // Send command to your server to trigger transfer
  viewerWs.send(JSON.stringify({
    action: "transfer_call", 
    callId: currentCallId,
    transferNumber: transferNumber
  }) ) ;
}
Your server would then handle these commands and send the appropriate response events to Retell AI through the LLM WebSocket connection . ## Limitations with Custom LLM Transfers Note that with Custom LLM integrations, you can only perform cold transfers [(2) ]() . Warm transfers with features like hold music and human detection are not available through the Custom LLM WebSocket interface .
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Phone transfer with custom LLM](https://discord.com/channels/1186424376300679209/1395018119050952825) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy It says Transfer queued and end call queued when I press related buttons
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​
### Answer ### Answer The "Transfer queued" and "End call queued" messages indicate that Retell AI has received your commands but they haven't been executed yet. This happens because these actions are only triggered after the content associated with the response is fully spoken [(1) ]() . ## Issue: Actions Execute After Speech Completion According to the LLM WebSocket protocol, both
end_call
and
transfer_number
fields only take effect after the content is fully spoken : - `end_call`: "If set to true, Retell would end the call after content associated with this id is fully spoken" - `transfer_number`: "If set, Retell would transfer the call to the number specified here after content associated with this id is fully spoken" ## Solution: Use Agent Interrupt Event To execute these actions immediately, you should use the Agent Interrupt Event instead of a regular response event :
Copy code
javascript
// For immediate end call
const endCallInterrupt = {
  response_type: "agent_interrupt",
  interrupt_id: Date.now() , // Unique interrupt ID
  content: "Goodbye!",
  content_complete: true,
  end_call: true,
  no_interruption_allowed: true // Recommended for interrupts
};
ws.send(JSON.stringify(endCallInterrupt) ) ;
Copy code
javascript
// For immediate transfer
const transferInterrupt = {
  response_type: "agent_interrupt", 
  interrupt_id: Date.now() ,
  content: "Transferring now...",
  content_complete: true,
  transfer_number: "+1234567890",
  no_interruption_allowed: true
};
ws.send(JSON.stringify(transferInterrupt) ) ;
## Why Agent Interrupt Works Better The Agent Interrupt Event will "stop the agent speech if the agent is speaking, or it will interrupt the user if the user is speaking" . This provides immediate execution rather than queuing the action. The
no_interruption_allowed: true
setting is recommended because "without this setting, if user is talking, and agent interrupts here, the two party would speak at the same time, and agent would get interrupted quickly" . Update your button handlers to use
agent_interrupt
instead of regular
response
events for immediate execution of end call and transfer actions.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy ReferenceError: Cannot access 'phrase' before initialization at file:///app/relay-server.js:437:18 at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) at next (/app/node_modules/express/lib/router/route.js:149:13) at Route.dispatch (/app/node_modules/express/lib/router/route.js:119:3) at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) at /app/node_modules/express/lib/router/index.js:284:15 at param (/app/node_modules/express/lib/router/index.js:365:14) at param (/app/node_modules/express/lib/router/index.js:376:14) at Function.process_params (/app/node_modules/express/lib/router/index.js:421:3) at next (/app/node_modules/express/lib/router/index.js:280:10) POST /control/call_e2aa09451b5000c989f22b78a71?token=aaf72b4df991f5c5c32cc398d401aa854b8e6d29ae9bc71c1ea406540ae6c0a1409b56aeffc661a802ae7006cc5a7209 500 148 - 1.482 ms ReferenceError: notifyControl is not defined at file:///app/relay-server.js:459:5 at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) at next (/app/node_modules/express/lib/router/route.js:149:13) at Route.dispatch (/app/node_modules/express/lib/router/route.js:119:3) at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) at /app/node_modules/express/lib/router/index.js:284:15 at param (/app/node_modules/express/lib/router/index.js:365:14) at param (/app/node_modules/express/lib/router/index.js:376:14) at Function.process_params (/app/node_modules/express/lib/router/index.js:421:3) at next (/app/node_modules/express/lib/router/index.js:280:10)
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
m
Here is what I get when I'm trying to execute end call
a
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer ### Answer You have two JavaScript errors in your code that need to be fixed: ## Error 1:
phrase
Variable Initialization The error
ReferenceError: Cannot access 'phrase' before initialization
at line 437 indicates you're trying to use a variable
phrase
before it's declared or in a temporal dead zone. This typically happens with
let
or
const
declarations. **Fix**: Ensure
phrase
is declared before it's used:
Copy code
javascript
// Make sure phrase is declared before use
let phrase = ""; // or const phrase = someValue;
// Then use phrase
## Error 2:
notifyControl
Function Not Defined The error
ReferenceError: notifyControl is not defined
at line 459 means you're calling a function that doesn't exist. **Fix**: You need to define the
notifyControl
function or check if you meant to call a different function. Based on your earlier code, you might need:
Copy code
javascript
// Define the function
function notifyControl(callId, message) {
  // Your notification logic here
  const room = getRoom(callId) ;
  // Send update to viewers or handle control notification
}

// Or if you meant to call sendUpdate:
sendUpdate(callId, message) ;
## Debugging Steps 1. **Check line 437**: Look for where
phrase
is used and ensure it's properly declared 2. **Check line 459**: Verify the
notifyControl
function exists or replace it with the correct function call 3. **Variable scope**: Make sure all variables are declared in the correct scope These are standard JavaScript coding errors unrelated to Retell AI's WebSocket protocol. The errors are preventing your control endpoint from working properly, which would affect your End Call and Transfer Call buttons.
message has been deleted
Thanks for the follow-up, @mil_d. I'll get back to you soon.
m
@AI Evy I sent you what I get when pressing end call
a
### Answer ### Answer I understand you're getting JavaScript errors when trying to execute the end call functionality. These are code errors in your server implementation that need to be fixed before the Retell AI WebSocket commands will work properly. ## Fix the JavaScript Errors First The errors you're seeing are preventing your control endpoint from processing the end call request: 1. **Line 437**:
phrase
variable is being used before initialization 2. **Line 459**:
notifyControl
function is not defined These need to be resolved in your server code before the Retell AI WebSocket events will work. ## Correct Agent Interrupt Event Format Once your JavaScript errors are fixed, make sure you're sending the Agent Interrupt Event in the correct format for immediate end call execution [(1) ]() :
Copy code
javascript
{
  "response_type": "agent_interrupt",
  "interrupt_id": 123,
  "content": "Goodbye!",
  "content_complete": true,
  "end_call": true,
  "no_interruption_allowed": true
}
## Why Agent Interrupt is Needed The Agent Interrupt Event will immediately "stop the agent speech if the agent is speaking, or it will interrupt the user if the user is speaking" . This provides immediate execution rather than queuing the action like regular response events. The
no_interruption_allowed: true
setting is recommended because "without this setting, if user is talking, and agent interrupts here, the two party would speak at the same time, and agent would get interrupted quickly" . Fix your JavaScript errors first, then the Agent Interrupt Event should execute the end call immediately instead of showing "End call queued".
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy I'm having hard time adding dynamic variables to my custom LLM, I see that these variables are transfered to Retell, but they are not reaching the "brain" of my llm. Any clues or code examples?
a
## Common Issue From the Discord discussion, one user found that dynamic variables only worked properly when included in the welcome message [(3) ]() . This suggests the variables might not be properly injected into the system prompt. Make sure you're: 1. Enabling call details in your config event [(1) ]() 2. Storing the dynamic variables from the call details event 3. Injecting them into your system prompt or context [(2) ]() The dynamic variables should be available in the
retell_llm_dynamic_variables
field of the call details event [(1) ]() .
### Answer Dynamic variables should be accessible through the call details event in your Custom LLM WebSocket connection [(1) ]() . Here's how to properly receive and use them: ## Receiving Dynamic Variables Dynamic variables are sent through the call details event when you enable it in your config event :
Copy code
javascript
// Send config event to enable call details
{
  "response_type": "config",
  "config": {
    "auto_reconnect": true,
    "call_details": true
  }
}
## Call Details Event Structure When call details are enabled, Retell will send you the dynamic variables in this format :
Copy code
javascript
{
  "interaction_type": "call_details",
  "call": {
    "call_id": "call_123",
    "agent_id": "agent_456", 
    "retell_llm_dynamic_variables": {
      "customer_name": "John Doe",
      "product_name": "Premium Plan",
      "account_status": "active"
    }
  }
}
## Implementation Example Based on the Node.js demo structure [(2) ]() , here's how to handle dynamic variables in your Custom LLM:
Copy code
typescript
export interface RetellRequest {
  response_id?: number;
  transcript: Utterance[];
  interaction_type: "update_only" | "response_required" | "reminder_required";
}
Store the dynamic variables when you receive the call details event, then inject them into your prompt preparation:
Copy code
typescript
private PreparePrompt(request: RetellRequest) {
  let transcript = this.ConversationToChatRequestMessages(request.transcript) ;
  let requestMessages: ChatRequestMessage[] = [
    {
      role: "system",
      content: agentPrompt + this.getDynamicVariableContext()
    },
  ];
  // ... rest of prompt preparation
}
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Integrate LLM](https://docs.retellai.com/integrate-llm/integrate-llm) [[3] Dynamic Variables](https://discord.com/channels/1186424376300679209/1340177140204699649) ​
Thanks for the follow-up, @mil_d. I'll get back to you soon.
m
@AI Evy why I'm getting this error every time? I have my "Agent Level Webhook URL" in "Webhook Settings" for agent starting with https:// 2025-09-10 15:10:11.096 call_08eeda10f55c69a25b2235ffb10 error: Error triggering webhook for call_started Axios Error: error code: ERR_BAD_REQUEST, error message: Unsupported protocol wss:
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer Based on the error you're getting, it appears you have a webhook URL configured with the
wss://
protocol somewhere in your agent settings [(1) ]() . This is causing the error because webhooks must use the ` protocol, not
wss://
[(1) ]() [(2) ]() . The error
Unsupported protocol wss:
indicates that somewhere in your agent configuration, a webhook URL is set to use the WebSocket protocol instead of HTTPS . ## Check These Settings 1. **Agent Level Webhook URL**: Should use ` format like `" 2. **Account Level Webhook**: If configured, should also use ` 3. **Phone Number Webhook**: If you have inbound call webhooks configured, these should also use ` [(3) ]() ## Webhook URL Format The webhook URL should be configured as [(1) ]() [(2) ]() :
Copy code
webhook_url: "<https://webhook-url-here%22>
## Common Confusion Points - **Custom LLM WebSocket URL**: Uses
wss://
protocol - **Webhook URLs**: Use ` protocol for HTTP POST requests ## Troubleshooting Steps 1. Check your agent's webhook configuration in the dashboard 2. Verify no webhook URLs are using
wss://
protocol 3. If you have both inbound call webhooks and agent level webhooks, ensure both use ` [(3) ]() The webhook timeout is set to 10000ms by default, and if not set, this default value will apply [(1) ]() [(2) ]() . From the Discord discussions, there have been previous issues with webhook URL saving that were resolved [(3) ]() [(4) ]() . Double-check that your webhook URL is properly saved and uses the correct ` protocol.
​ To learn more, see the sources I considered: [[1] Create Agent](https://docs.retellai.com/api-references/create-agent) [[2] Update Agent](https://docs.retellai.com/api-references/update-agent) [[3] inbound webhook URL failing to save (or stay saved) and wont work together with conversation agaent](https://discord.com/channels/1186424376300679209/1398428473781125314) [[4] Hi, we are facing problems when saving the agent level webhook URL as in the image. Can you help me?](https://discord.com/channels/1186424376300679209/1290363362164871313) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy Why i'm getting duplicated transcript messages? { role: 'user', content: 'Hey. This is Max with Arrive Logistics.', words: [Array] }, { role: 'agent', content: 'Hi, ', words: [Array], metadata: [Object] } ], interaction_type: 'update_only' } 2025-09-11 17:56:23.516 call_366a88b7bee7b681872a23a9cdd verbose: Sending updates (transcript trimmed to last 2 utterances): { transcript: [ { role: 'user', content: 'Hey. This is Max with Arrive Logistics.', words: [Array] }, { role: 'agent', content: 'Hi, this ', words: [Array], metadata: [Object] } ], interaction_type: 'update_only' } 2025-09-11 17:56:23.523 call_366a88b7bee7b681872a23a9cdd verbose: LLM pingpong event received 2025-09-11 17:56:23.668 call_366a88b7bee7b681872a23a9cdd verbose: Sending updates (transcript trimmed to last 2 utterances): { transcript: [ { role: 'user', content: 'Hey. This is Max with Arrive Logistics.', words: [Array] }, { role: 'agent', content: 'Hi, this is ', words: [Array], metadata: [Object] } ], interaction_type: 'update_only' } 2025-09-11 17:56:23.877 call_366a88b7bee7b681872a23a9cdd verbose: Sending updates (transcript trimmed to last 2 utterances): { transcript: [ { role: 'user', content: 'Hey. This is Max with Arrive Logistics.', words: [Array] }, { role: 'agent', content: 'Hi, this is Anna ', words: [Array], metadata: [Object] } ], interaction_type: 'update_only' } 2025-09-11 17:56:24.029 call_366a88b7bee7b681872a23a9cdd verbose: Sending updates (transcript trimmed to last 2 utterances): { transcript: [ { role: 'user', content: 'Hey. This is Max with Arrive Logistics.', words: [Array] }, {
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer ## This is Expected Behavior - Live Transcript Updates The "duplicated" transcript messages you're seeing are actually live transcript corrections as the agent speaks in real-time [(1) ]() . This is the expected behavior for Retell AI's WebSocket protocol [(2) ]() . ## How Live Transcripts Work According to the documentation, Retell sends Update Only Events continuously as the transcript updates [(1) ]() : - `interaction_type: "update_only"`: Event type that contains the latest transcript or turntaking information, no response required - The transcript field contains the "Complete live transcript collected in the call so far" ## Real-Time Speech Correction From the Discord discussion, this behavior is explained by a Retell AI team member [(2) ]() : "yeah the transcript is correcting itself overtime, and we are sending the latest update to you all the time, so you do see the corrections" "no every time we send something it's going to be the full transcript. So you would have the full sentence" ## What You're Seeing In your logs, the agent's response is being built incrementally: - "Hi, " - "Hi, this " - "Hi, this is " - "Hi, this is Anna " Each update contains the complete transcript with the corrected/extended version . ## How to Handle Multiple Updates The recommended approach is to "always let the latest one generate the response and drop the previous ones" . The GitHub demo repositories include mechanisms to handle potentially duplicate transcripts by checking the latest value of
response_id
and not sending responses if they are stale . This is normal behavior for live speech
recognition and ensures you always have the most accurate transcript as the conversation progresses.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Multiple Transcripts in Websocket](https://discord.com/channels/1186424376300679209/1252583093160902656) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy Why I'm getting duplicated message even Custome have said nothing?
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer ### Answer You're getting duplicate messages even when the customer hasn't said anything because Retell AI sends Update Only Events continuously during the call, not just when someone speaks [(1) ]() . ## Update Only Events Are Sent for Multiple Reasons According to the LLM WebSocket documentation, Update Only Events are triggered by : - When transcript updates (either user speaks or agent speaks) - When turntaking happens The
turntaking
field indicates "change of speaker (turn taking) " and will be present when speaker changes to user (
user_turn
) or right before agent is about to speak (
agent_turn
) . ## Why You See Updates Without Speech Even when the customer hasn't spoken, Retell AI may send Update Only Events because : 1. **Turntaking detection**: The system is detecting potential speaker changes 2. **Agent preparation**: Right before the agent is about to speak, you'll receive an event with
turntaking: "agent_turn"
3. **Silence processing**: The system may be processing periods of silence to determine next actions ## Event Structure During Silence During periods when no one is speaking, you might still receive events like:
Copy code
json
{
  "interaction_type": "update_only",
  "transcript": [...],
  "turntaking": "agent_turn"
}
## How to Handle This The Update Only Events are informational and "no response required" . You should process these events to stay updated on the call state but not generate responses unless you receive a
response_required
or
reminder_required
event . This behavior ensures your system stays synchronized with Retell AI's call state, even during periods of silence or speaker transitions.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy How can I adjust my "live transcript" so I see it in my plugin exactly how Retell showing Live transcript during test call inside Agent Testing? Here is what i'm getting now: { role: 'user', content: "Hey. This is Max. It's", words: [Array] } ], interaction_type: 'update_only' } 2025-09-12 15:17:48.390 call_3aa833c60cf8efeef6f31b555b1 verbose: Sending updates (transcript trimmed to last 2 utterances): { transcript: [ { role: 'user', content: 'Hey. This is Max with Squawk.', words: [Array] } ], interaction_type: 'update_only' } 2025-09-12 15:17:48.428 call_3aa833c60cf8efeef6f31b555b1 verbose: Requesting response (transcript trimmed to last 2 utterances): { response_id: 3, transcript: [ { role: 'user', content: 'Hey. This is Max with Squawk.', words: [Array] } ], interaction_type: 'response_required' } 2025-09-12 15:17:48.568 call_3aa833c60cf8efeef6f31b555b1 verbose: LLM pingpong event received 2025-09-12 15:17:48.619 call_3aa833c60cf8efeef6f31b555b1 verbose: Sending updates (transcript trimmed to last 2 utterances): { transcript: [ { role: 'user', content: 'Hey. This is Max with Clark.', words: [Array] } ],
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer ## Understanding the Live Transcript Format To match Retell AI's Agent Testing live transcript display, you need to understand how the transcript data is structured in the WebSocket events [(1) ]() . ## Current Live Transcript Issues Based on the Discord discussion, there are known issues with live transcripts in Custom LLM implementations [(2) ]() . Users have reported that "after few streamed words (a sentence usually) , the entire response is dumped in the transcript object, creating a big mismatch as to what the model is speaking, and what the caption is" . The issue appears to be that "whenever there is more than 7ms delay b/w two words then the whole sentence after that word gets dumped all together and audio comes quite late" . ## Transcript Structure from WebSocket The transcript data you're receiving through Update Only Events contains [(1) ]() : - `role`: Either "user" or "agent" - `content`: The text content of the utterance - `words`: Array containing word-level timing information ## Word-Level Timing Access To create a live transcript that matches Retell's Agent Testing display, you would need access to the
words
array which contains timestamp information. However, the current Custom LLM WebSocket implementation has limitations [(2) ]() . From the Discord discussion, users have requested: "Can the 'words' list with timestamp (like in rest api call) be provided for custom llm update object?" ## Workaround Approaches Since there are known issues with live transcript synchronization in Custom LLM implementations , some users have had to "disable transcripts" due to the problems . For a
more accurate live transcript display, you might need to: 1. Process the
content
field from transcript updates more carefully 2. Handle the fact that "the entire transcript appears while the AI is still speaking" 3. Account for the timing mismatch between audio and transcript ## Current Limitations The live transcript functionality in Custom LLM has known issues that are "hampering user experience" and "damaging demos" according to multiple users in the Discord community . This appears to be a system-level issue rather than an implementation problem on your end. Until these core transcript synchronization issues are resolved, achieving perfect parity with Retell's Agent Testing live transcript display may not be possible with Custom LLM implementations .
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Live transcripts in Custom LLM](https://discord.com/channels/1186424376300679209/1343913896158826586) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy can I increase a delay in sending messages to my LLM so its will not be hammered with multiple similar updates?
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer Based on the available sources, there isn't a built-in setting in Retell AI's WebSocket protocol to add delays or throttle the frequency of messages sent to your LLM [(1) ]() . ## What You're Experiencing The multiple similar updates you're receiving are part of Retell AI's live transcript correction system . These
update_only
events are sent continuously as the transcript updates and during turntaking events . ## Potential Server-Side Solutions While you can't control Retell AI's message frequency, you can implement throttling on your server side: 1. **Debouncing**: Only process the latest update after a brief delay 2. **Response ID Checking**: The GitHub demo repositories include mechanisms to handle potentially duplicate transcripts by checking the latest value of
response_id
and not sending responses if they are stale ## Important Distinction Remember that
update_only
events require no response . You should only generate responses when you receive: -
response_required
events -
reminder_required
events ## Streaming Response Timing From the Discord discussion, there are some timing considerations for streaming responses. If you don't send any data within 1 second, Retell AI will trigger audio generation anyway [(2) ]() . Additionally, complete sentences with punctuation will trigger audio generation . The multiple updates are by design to keep your system synchronized with the live transcript corrections, but you can implement your own server-side logic to reduce processing overhead while still maintaining responsiveness to actual response requests.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] LLM Websocket streaming response hint mechanism?](https://discord.com/channels/1186424376300679209/1236747855520202762) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy I'mm hearing silence during phone call. my custom llm agent is noit saying anything. Here is error from a call log: 2025-09-12 18:35:09.970 call_4317970a18cb6fe4fdc19bd77d2 error: Error in parsing LLM websocket message: content_complete not a boolean {"response_id":2,"interaction_type":"response","content":"Hi, this is Anna with Max Trucking. I’m calling about your load from Chicago, IL to Cleveland, OH."}
a
Thanks for the follow-up, @mil_d. I'll get back to you soon.
### Answer ### Answer The error shows that your WebSocket message is missing the required
content_complete
field [(1) ]() . The agent isn't speaking because Retell AI can't parse your response message properly. ## Fix the Missing Field Your current message structure is missing the required
content_complete
boolean field :
Copy code
json
{
  "response_id": 2,
  "interaction_type": "response",
  "content": "Hi, this is Anna with Max Trucking. I'm calling about your load from Chicago, IL to Cleveland, OH."
}
## Correct Response Event Format According to the LLM WebSocket specification, the Response Event requires these fields : - `response_type`: Must be "response" - `response_id`: Integer indicating which requested response this is answering - `content`: The response content - `content_complete`: Boolean indicating whether the content is complete Here's the corrected format :
Copy code
json
{
  "response_type": "response",
  "response_id": 2,
  "content": "Hi, this is Anna with Max Trucking. I'm calling about your load from Chicago, IL to Cleveland, OH.",
  "content_complete": true
}
## Why content_complete is Required From the Discord discussion, users found that "setting content complete False was streaming fine" but later discovered they "have to set content_complete to 'true' to get it to actually speak" [(2) ]() . The streaming logic works as follows [(3) ]() : - Will start streaming either when a complete sentence is met - Or will start streaming once the content is complete Setting
content_complete: true
tells Retell AI that your response is finished and ready to be spoken . ## Implementation Fix Make sure your response sending function includes the
content_complete
field:
Copy code
typescript
const res: CustomLlmResponse = {
    response_type: "response",
    response_id: response_id,
    content: content,
    content_complete: true,
    end_call: false
};
ws.send(JSON.stringify(res) ) ;
Once you add the missing
content_complete: true
field, your agent should start speaking properly.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Custom LLM websockets don't seem to be working](https://discord.com/channels/1186424376300679209/1233976191472635977) [[3] Issue with 11Labs voice when content complete is set false.](https://discord.com/channels/1186424376300679209/1233352616684032012) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.