> ## Documentation Index
> Fetch the complete documentation index at: https://docs.navtalk.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# realtime.response.function_call_arguments.done

> Function call request event

Triggered when the AI determines that a function call is needed during the conversation. Handle this event to execute external API calls, query knowledge bases, or integrate with external systems.

## Event Properties

<ResponseField name="type" type="string">
  Event type. Always `"realtime.response.function_call_arguments.done"` for this event.
</ResponseField>

<ResponseField name="data" type="object">
  Event data object containing function call information.
</ResponseField>

<ResponseField name="data.arguments" type="string">
  JSON string containing function call parameters.

  **Example**: `"{\"userInput\": \"What's the weather in Beijing?\"}"`
</ResponseField>

<ResponseField name="data.call_id" type="string">
  Unique identifier for this function call.

  **Example**: `"call-123456"`
</ResponseField>

<ResponseExample>
  ```json Example theme={null}
  {
    "type": "realtime.response.function_call_arguments.done",
    "data": {
      "arguments": "{\"userInput\": \"What's the weather in Beijing?\"}",
      "call_id": "call-123456"
    }
  }
  ```
</ResponseExample>

## Usage Example

```javascript theme={null}
const NavTalkMessageType = Object.freeze({
    REALTIME_RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE: "realtime.response.function_call_arguments.done",
    // ... other event types
});

async function handleReceivedMessage(data) {
    const nav_data = data.data;
    
    switch (data.type) {
        case NavTalkMessageType.REALTIME_RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE:
            const arguments = nav_data.arguments;
            const callId = nav_data.call_id;
            
            // Parse function call arguments
            const functionCallArgs = JSON.parse(arguments);
            
            // Execute function call
            const result = await executeFunctionCall(functionCallArgs);
            
            // Send result back only if the AI should continue with this result
            sendFunctionCallResult(result, callId);
            break;
    }
}

function sendFunctionCallResult(result, callId) {
    const resultJson = {
        type: "realtime.function_call_output",
        data: {
            content: result,
            call_id: callId,
            reply: "1"
        }
    };
    socket.send(JSON.stringify(resultJson));
}
```

<Note>
  Send `realtime.function_call_output` when you want the AI to continue the conversation using the function result. Set `data.reply` to `"1"` to trigger the follow-up response. If the function call only triggers external business logic and no follow-up AI response is needed, you can skip this return step.
</Note>
