{
    "VoiceElements_Instructions": {
        "aiUrl": {
            "url": "wss://api.openai.com/v1/realtime?model=gpt-realtime",
            "headers": {
                "Authorization": "Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
            }
        },
        "maxSeconds": 300,
        "customerCallId": "CallId-001",
        "defaultToolsUrlBase": {
            "url": "https://ivlresttest.voiceelements.com/v1/aitool",
            "headers": {
                "Token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
            }
        },
        "defaultToolsUrlAdapter": null,
        "routeToNumberOnFailure": null,
        "messageToPlayOnFailure": "The AI system is currently offline.  Please Call back later",
        "logToolCallRequests": false,
        "logToolCallReplies": false,
        "logTranscription": false,
        "recordCall": false,
        "recordCallFormat" : "opus",
        "recordCallPassword" : "YourPassword",
        "transcriptionToolName" : "your_custom_tool_name_for_transcriptions"
    },
    "event_id": "start_1",
    "type": "session.update",
    "session": {
        "type": "realtime",
        "instructions": "You are a friendly agent. Explain that you can look up a name by a phone number or a phone number by a name.  If the user gives you a phone number or name, call the function lookup_name_or_phone with passing the appropriate parameter.  Read back to the user what was returned and ask them if they wish to look up another or end the call.  The call can be concluded by calling the vns_end_conversation tool.",
        "model": "gpt-realtime",
        "audio": {
            "input": {
                "format": {
                    "type": "audio/pcmu"
                },
                "transcription": {
                    "model": "whisper-1"
                },
                "turn_detection": {
                    "type": "server_vad",
                    "threshold": 0.65,
                    "prefix_padding_ms": 300,
                    "silence_duration_ms": 300,
                    "create_response": true,
                    "interrupt_response": true,
                    "idle_timeout_ms": 30000
                },
                "noise_reduction": null
            },
            "output": {
                "format": {
                    "type": "audio/pcmu"
                },
                "voice": "alloy"
            }
        },
        "tool_choice": "auto",
        "tools": [
            {
                "name": "vns_end_conversation",
                "description": "If the user says something about ending the conversation, like goodbye, call a function to let the application know.",
                "type": "function",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "user_input": {
                            "type": "string",
                            "description": "Input from the user indicating they want to end the conversation."
                        }
                    },
                    "required": [
                        "user_input"
                    ]
                }
            },
            {
                "name": "vns_get_call_info",
                "description": "Call this function to get information about the Called Number, Caller Id, Caller Id Name, the Call Start Time (UTC), If the call was inbound or outbound and the SessionGuid and CustomerCall Id.",
                "type": "function",
                "parameters": {
                    "type": "object",
                    "properties": {}
                }
            },
            {
                "name": "vns_get_utc_datetime",
                "description": "Retrieves the current UTC date and time.",
                "type": "function",
                "parameters": {
                    "type": "object",
                    "properties": {}
                }
            },
            {
                "name": "vns_transfer_call",
                "description": "Transfers the current call to another number.",
                "type": "function",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "transferNumber": {
                            "type": "string",
                            "description": "The phone number to transfer the call to, preferably in E.164 format like +13035551212"
                        },
                        "useVnsNumberAsCallerId": {
                            "type": "boolean",
                            "description": "If true, uses the Called Number as the outbound caller ID for the transferred call, otherwise it uses the callers number."
                        },
                        "attended": {
                            "type": "boolean",
                            "description": "If true, performs an attended transfer where the agent speaks to the destination before completing the transfer."
                        }
                    },
                    "required": [
                        "transferNumber"
                    ]
                }
            },
            {
                "name": "lookup_name_or_phone",
                "description": "A example customer specific tool that looks up the name of a person from a phone number or looks up the phone number of a person from a name.",
                "type": "function",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string",
                            "description": "Name of the person to search for."
                        },
                        "phoneNumber": {
                            "type": "string",
                            "description": "Phone number to search, preferably in E.164 format like +13035551212"
                        }
                    }
                }
            }
        ]
    }
}