https://retellai.com/?utm_source=discord&utm_medium=seo logo
do you have api to record action from retell like:...
# ❓・ai-evy-support
n
@AI Evy do you have api to record action from retell like: User pressed keypad: 0 0:07 digit: 0
a
Thanks for tagging me @Nameless. I'll look through relevant sources and get back to you shortly.
### Answer Yes, Retell AI supports DTMF (keypad) input capture through the
allow_user_dtmf
parameter and
user_dtmf_options
configuration. [(1) ]() [(2) ]() [(3) ]() When creating calls, you can enable DTMF capture with these settings:
Copy code
json
"allow_user_dtmf": true,
"user_dtmf_options": {
  "digit_limit": 25.5,
  "termination_key": "#",
  "timeout_ms": 8000
}
[(1) ]() , [(2) ]() , [(3) ]() The
user_dtmf_options
allows you to configure: [(1) ]() [(2) ]() [(3) ]() - `digit_limit`: Maximum number of digits to capture - `termination_key`: Key that ends DTMF input (e.g., "#") - `timeout_ms`: Timeout period for DTMF collection To retrieve the captured DTMF data, you can use the Get Call API to access call transcripts and details, or set up webhooks to receive real-time updates when calls are initiated, end, and analyzed. [(4) ]()
​ To learn more, see the sources I considered: [[1] Create Web Call](https://docs.retellai.com/api-references/create-web-call) [[2] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) [[3] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[4] Receive calls](https://docs.retellai.com/deploy/inbound-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy WHAT WILL be the python code to change import json file based on session id or something to a chatbot
a
Thanks for the follow-up, @Nameless. I'll get back to you soon.
### Answer I don't have specific information in the available sources about importing JSON files based on session ID for a chatbot in Retell AI. However, based on the WebSocket server setup documentation, here's how you would structure Python code to handle different calls using their unique identifiers: [(1) ]()
Copy code
python
import json
import os
from dotenv import load_dotenv
from fastapi import FastAPI, Request, WebSocket

from fastapi.responses import JSONResponse, PlainTextResponse
from fastapi.websockets import WebSocketState
app = FastAPI()
@app.websocket("/llm-websocket/{call_id}")
async def websocket_handler(websocket: WebSocket, call_id: str) :
 await websocket.accept()
 # A unique call id is the identifier of each call
 print(f"Handle llm ws for: {call_id}")
 # You need to send the first message here, but for now let's skip that.
 # listen for new updates
 try:
 while True:
 message = await websocket.receive_text()
 print(message) ;
 except Exception as e:
 print(f'LLM WebSocket error for {call_id}: {e}')
 finally:
 try:
 await websocket.close()
 except RuntimeError as e:
 print(f"Websocket already closed for {call_id}")
 print(f"Closing llm ws for: {call_id}")
You could extend this to load JSON configuration files based on the
call_id
parameter, which serves as the unique identifier for each call session. If you need more specific guidance on importing JSON files for different sessions or accessing call metadata, I'd recommend checking the full documentation or reaching out through the official support channels. **
​ To learn more, see the sources I considered: [[1] 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.
n
@AI Evy draft me a sample python code to extract current json of the retell conversation chatbot + to replace it with a new json file i have on hand
a
Thanks for the follow-up, @Nameless. I'll get back to you soon.
### Answer Based on the LLM WebSocket documentation, here's how to extract and manage conversation data during a Retell AI call: [(1) ]()
This code: - Extracts conversation data from
update_only
,
response_required
, and
reminder_required
events - Saves the current conversation state to a JSON file - Loads a new JSON configuration file when available - Sends responses back through the WebSocket using the
response_type
format The
transcript
field in these events contains the conversation history with role and content for each utterance.
Copy code
python
import json
import asyncio
from fastapi import WebSocket

# Store conversation data per call
conversation_store = {}

@app.websocket("/llm-websocket/{call_id}")
async def websocket_handler(websocket: WebSocket, call_id: str) :
    await websocket.accept()
    
    # Initialize conversation storage for this call
    conversation_store[call_id] = {
        "transcript": [],
        "tool_calls": []
    }
    
    try:
        while True:
            message = await websocket.receive_text()
            data = json.loads(message)
            
            # Extract transcript from update events
            if data.get("interaction_type") in ["update_only", "response_required", "reminder_required"]:
                if "transcript" in data:
                    conversation_store[call_id]["transcript"] = data["transcript"]
                    
                    # Save current state to file
                    with open(f"conversation_{call_id}.json", "w") as f:
                        json.dump(conversation_store[call_id], f, indent=2)
            
            # Load and apply new configuration
            new_config_path = f"new_config_{call_id}.json"
            if os.path.exists(new_config_path) :
                with open(new_config_path, "r") as f:
                    new_data = json.load(f)
                    
                # Send response with new data
                response = {
                    "response_type": "response",
                    "response_id": data.get("response_id", 0) ,
                    "content": new_data.get("content", "") ,
                    "content_complete": True
                }
                await websocket.send_text(json.dumps(response) )
                
    except Exception as e:
        print(f"Error for {call_id}: {e}")
    finally:
        # Export final conversation data
        final_export = f"final_conve
​ 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.
Copy code
rsation_{call_id}.json"
        with open(final_export, "w") as f:
            json.dump(conversation_store[call_id], f, indent=2)
        
        await websocket.close()
n
@AI Evy no i mean i want to start with something like this: import os from retell import Retell # Initialize Retell client client = Retell(api_key="key_xxxxxx") # Replace with your values agent_id = "agent_xxxxxxx" # Step 1: Get the agent and extract conversation_flow_id agent = client.agent.retrieve(agent_id) response_engine = agent.response_engine if isinstance(response_engine, dict): conversation_flow_id = response_engine.get("conversation_flow_id") else: conversation_flow_id = getattr(response_engine, "conversation_flow_id", None) if not conversation_flow_id: raise ValueError("No conversation_flow_id found on this agent.")
a
Thanks for the follow-up, @Nameless. I'll get back to you soon.
### Answer Great! Here's a complete Python code example that builds on your starting point to retrieve a conversation flow, modify it, and update it back to Retell AI: [(1) ]() [(2) ]()
Copy code
python
import os
from retell import Retell

# Initialize Retell client
client = Retell(api_key="key_xxxxxx")

# Replace with your values
agent_id = "agent_xxxxxxx"

# Step 1: Get the agent and extract conversation_flow_id
agent = client.agent.retrieve(agent_id)
response_engine = agent.response_engine

if isinstance(response_engine, dict) :
    conversation_flow_id = response_engine.get("conversation_flow_id")
else:
    conversation_flow_id = getattr(response_engine, "conversation_flow_id", None)

if not conversation_flow_id:
    raise ValueError("No conversation_flow_id found on this agent.")

# Step 2: Retrieve the current conversation flow
conversation_flow_response = client.conversationFlow.retrieve(conversation_flow_id)
print(conversation_flow_response.conversation_flow_id)
[(1) ]() Now to modify and update the conversation flow: [(2) ]()
Copy code
python
# Step 3: Extract current flow data
current_flow = conversation_flow_response

# Step 4: Load your new JSON configuration
import json
with open("new_conversation_flow.json", "r") as f:
    new_flow_data = json.load(f)

# Step 5: Update the conversation flow with new data
updated_flow = client.conversationFlow.update(
    conversation_flow_id=conversation_flow_id,
    model_choice=new_flow_data.get("model_choice") ,
    model_temperature=new_flow_data.get("model_temperature") ,
    nodes=new_flow_data.get("nodes") ,
    start_speaker=new_flow_data.get("start_speaker") ,
    global_prompt=new_flow_data.get("global_prompt") ,
    # Add other fields as needed from your JSON
)

print(f"Updated conversation flow: {updated_flow.conversation_flow_id}")
The key API methods you'll use are: [(1) ]() [(2) ]() [(3) ]() -
client.conversationFlow.retrieve(conversation_flow_id)
- Gets the current conversation flow [(1) ]() -
client.conversationFlow.update()
- Updates an existing conversation flow [(2) ]() -
client.conversationFlow.list()
- Lists all conversation flows [(3) ]() Your new JSON file should match the conversation flow schema with fields like
model_choice
,
nodes
,
start_speaker
,
global_prompt
,
tools
, etc. [(2) ]()
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] Get Conversation Flow](https://docs.retellai.com/api-references/get-conversation-flow) [[2] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) [[3] List Conversation Flows](https://docs.retellai.com/api-references/list-conversation-flows) ​
n
@AI Evy I have an action with setting "skip after user response" but it won't trigger next step if user is silence, what can i do
a
Thanks for the follow-up, @Nameless. I'll get back to you soon.
### Answer The "Skip Response" setting you're referring to works differently than waiting for user silence. When Skip Response is enabled on a node, the node transitions immediately after the agent finishes speaking, without waiting for any user reply at all. [(1) ]() If you need the agent to proceed after user silence (when the user doesn't respond) , you should use the begin_after_user_silence_ms parameter instead. This parameter specifies how long (in milliseconds) the AI will wait for the user to speak before beginning the conversation or moving forward. [(2) ]() For example, you can set this in your Retell LLM configuration:
Copy code
json
"begin_after_user_silence_ms": 2000
This would make the agent wait 2000ms (2 seconds) of user silence before proceeding. If not set, the agent will wait indefinitely for the user to speak. To clarify the difference: - **Skip Response**: Node transitions when the agent finishes speaking, no user input needed [(1) ]() - **begin_after_user_silence_ms**: Agent proceeds after waiting the specified duration when user is silent [(2) ]() If you're using conversation flow nodes and need to handle user silence differently, consider using transition conditions with an else edge as a fallback when no other condition matches, which can help ensure the flow doesn't get stuck. [(3) ]()
​ To learn more, see the sources I considered: [[1] Subagent node](https://docs.retellai.com/build/conversation-flow/subagent-node) [[2] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) [[3] Transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy Skip Response: Node transitions when the agent finishes speaking, no user input needed (1) i have this setting in place, but i dunno what happaned
a
Thanks for the follow-up, @Nameless. I'll get back to you soon.
### Answer When Skip Response is enabled on a conversation or subagent node, the node should get a single edge and transition through it when the agent finishes speaking, without waiting for a reply. [(1) ]() [(2) ]() Here are some troubleshooting steps: 1. Check your edge configuration When Skip Response is enabled, the node should only have one outgoing edge. Make sure you've connected that edge to your next node. 2. Verify node type Skip Response is available on: - Conversation nodes [(1) ]() - Subagent nodes [(2) ]() Confirm you're using one of these node types, not a function node or other type. [(3) ]() 3. Check transition conditions With Skip Response enabled, you shouldn't need transition conditions on that edge - it should transition automatically. Remove any conditions if present. [(4) ]() 4. Test the agent speaks first If this is at the beginning of your flow and the agent isn't speaking, the node won't transition. Based on a similar issue reported, you may need to click inside the begin message node in the flow to configure it properly. [(5) ]() 5. Review the flow structure Make sure the node with Skip Response enabled has an instruction that causes the agent to speak. If the agent doesn't generate any speech, the transition won't trigger. [(1) ]() If you're still experiencing issues after checking these points
, could you share: - Which node type you're using (conversation or subagent) - Whether the agent is actually speaking in that node - Your agent ID or conversation flow ID This will help diagnose the specific issue.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy can retell distinguish whether the caller is female or male by voice
a
Thanks for the follow-up, @Nameless. I'll get back to you soon.
### Answer I don't have information in the available sources about Retell AI's ability to detect or distinguish caller gender based on voice characteristics. The Automatic Speech Recognition (ASR) documentation describes ASR as converting spoken language into written text for transcription purposes, but doesn't mention gender detection capabilities. [(1) ]() If you need this type of analysis, I'd recommend: - Visiting [Documentation]() - Visiting [Hire certified Retell partner]() Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Automatic Speech Recognition (ASR)](https://www.retellai.com/glossary/automatic-speech-recognition-asr) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy gender detection
a
Thanks for the follow-up, @Nameless. I'll get back to you soon.
### Answer I don't have information in the available sources about gender detection capabilities in Retell AI. The available documentation on Speech Processing [(1) ]() and Automatic Speech Recognition (ASR) [(2) ]() [(3) ]() focuses on converting spoken language into text for transcription and understanding caller intent, but doesn't mention gender detection or voice-based demographic analysis features. If you need this type of capability, I'd recommend: - Visiting [Documentation]() - Visiting [Hire certified Retell partner]() Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Speech Processing](https://www.retellai.com/glossary/speech-processing) [[2] Automatic Speech Recognition (ASR)](https://www.retellai.com/glossary/automatic-speech-recognition-asr) [[3] Smarter Understanding, Clearer Calls: Retell’s ASR Just Got a Major Upgrade | Retell AI](https://www.retellai.com/blog/retell-asr) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy can we now create call flow from prompt? can you describe how is it done
a
Thanks for the follow-up, @Nameless. I'll get back to you soon.
### Answer I don't have information in the available sources about creating conversation flows directly from a text prompt. The available documentation shows that conversation flows are created through the Conversation Flow API using structured data with nodes, edges, and configuration parameters. [(1) ]() The standard approach involves: 1. Using the API to create a conversation flow with defined structure 2. Building flows visually in the dashboard using the node-based editor [(2) ]() 3. Starting from templates or building from scratch [(3) ]() The Conversation Flow API allows programmatic creation and management of flows, but requires you to define the flow structure with specific fields like
model_choice
,
nodes
,
start_speaker
,
global_prompt
, and
tools
. [(1) ]() If you're looking for a way to generate conversation flows from natural language descriptions, I'd recommend: - Visiting [Documentation]() - Visiting [Hire certified Retell partner]() Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[2] Nodes and edges](https://docs.retellai.com/build/conversation-flow/node) [[3] Inside Retell AI | The Conversational AI Platform Behind Scalable AI Phone Systems | Retell AI](https://www.retellai.com/blog/inside-retell-ai-conversational-ai-phone-system) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.