> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# कॉल समाप्त करें

> **Warning**
>
> **कॉल समाप्त करें** टूल डिफ़ॉल्ट रूप से ElevenLabs डैशबोर्ड में बनाए गए एजेंट्स में जोड़ा जाता है। API या SDK के ज़रिए
> बनाए गए एजेंट्स के लिए, अगर आप कॉल समाप्त करें टूल को सक्षम करना चाहते हैं, तो आपको इसे
> अपने एजेंट कॉन्फ़िगरेशन में मैन्युअल रूप से सिस्टम टूल के रूप में जोड़ना होगा। जानकारी के लिए [नीचे API इम्प्लीमेंटेशन देखें](#api-implementation)।

![कॉल समाप्त करें](/docs/_fern-img/f260bfd4e43f7fb0374ce12d2ed984efb946a8ca9ebaa1c2d4b3e6d5f52a7851.webp)

## ओवरव्यू

**कॉल समाप्त करें** टूल आपके कन्वर्सेशनल एजेंट को यूज़र के साथ कॉल समाप्त करने देता है। यह एक सिस्टम टूल है, जो कॉल कब और कैसे समाप्त हों, इसमें लचीलापन देता है।

## कार्यक्षमता

* **डिफ़ॉल्ट व्यवहार**: यह टूल बिना किसी यूज़र-निर्धारित प्रॉम्प्ट के काम कर सकता है और बातचीत स्वाभाविक रूप से पूरी होने पर कॉल समाप्त कर देता है।
* **कस्टम प्रॉम्प्ट्स**: यूज़र वे शर्तें तय कर सकते हैं, जिनमें कॉल समाप्त होनी चाहिए। उदाहरण के लिए:
  * यूज़र के "अलविदा" कहने पर कॉल समाप्त करें।
  * कोई खास काम पूरा होने पर कॉल समाप्त करें।

**उद्देश्य**: उचित शर्तें पूरी होने पर बातचीत अपने-आप समाप्त करें।

**ट्रिगर शर्तें**: LLM को इस टूल को तब कॉल करना चाहिए, जब:

* मुख्य टास्क पूरा हो गया हो और यूज़र संतुष्ट हो
* आपसी सहमति के साथ बातचीत स्वाभाविक निष्कर्ष पर पहुंच गई हो
* यूज़र साफ़ तौर पर बातचीत खत्म करने की इच्छा जताए

**पैरामीटर**:

* `reason` (string, आवश्यक): कॉल खत्म करने का कारण
* `message` (string, वैकल्पिक): कॉल खत्म करने से पहले यूज़र को भेजा जाने वाला विदाई मैसेज

**फंक्शन कॉल फ़ॉर्मैट**:

```json
{
  "type": "function",
  "function": {
    "name": "end_call",
    "arguments": "{\"reason\": \"Task completed successfully\", \"message\": \"Thank you for using our service. Have a great day!\"}"
  }
}
```

**इम्प्लीमेंटेशन**: अपनी एजेंट सेटिंग्स में इसे सिस्टम टूल के रूप में कॉन्फ़िगर करें। LLM को इस फंक्शन को कॉल करने के समय के बारे में विस्तृत निर्देश मिलेंगे।

### API इम्प्लीमेंटेशन

API के ज़रिए एजेंट बनाते समय, आप अपने एजेंट कॉन्फ़िगरेशन में कॉल समाप्त करें टूल जोड़ सकते हैं। इसे सिस्टम टूल के रूप में परिभाषित किया जाना चाहिए:

```python
from elevenlabs import AgentConfig, ConversationalConfig, ElevenLabs

elevenlabs = ElevenLabs(api_key="YOUR_API_KEY")

response = elevenlabs.conversational_ai.agents.create(
    conversation_config=ConversationalConfig(
        agent=AgentConfig(
            prompt={
                "built_in_tools": {
                    "end_call": {
                        "type": "system",
                        "name": "end_call",
                        # Optional: customize when the tool should be triggered
                        "description": "",
                        "params": {"system_tool_type": "end_call"},
                    }
                }
            },
        ),
    ),
)
```

```javascript
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";

const elevenlabs = new ElevenLabsClient({
  apiKey: "YOUR_API_KEY",
});

await elevenlabs.conversationalAi.agents.create({
  conversationConfig: {
    agent: {
      prompt: {
        builtInTools: {
          endCall: {
            type: "system",
            name: "end_call",
            description: "", // Optional: Customize when the tool should be triggered
            params: { systemToolType: "end_call" },
          },
        },
      },
    },
  },
});
```

```bash
curl -X POST https://api.elevenlabs.io/v1/convai/agents/create \
     -H "xi-api-key: YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
  "conversation_config": {
    "agent": {
      "prompt": {
        "built_in_tools": {
          "end_call": {
            "type": "system",
            "name": "end_call",
            "description": "",
            "params": { "system_tool_type": "end_call" }
          }
        }
      }
    }
  }
}'
```

> **Tip**
>
> डिफ़ॉल्ट कॉल समाप्त करने वाला प्रॉम्प्ट इस्तेमाल करने के लिए, विवरण खाली छोड़ दें।

## उदाहरण प्रॉम्प्ट्स

**उदाहरण 1: बुनियादी कॉल समाप्ति**

```
End the call when the user says goodbye, thank you, or indicates they have no more questions.
```

**उदाहरण 2: कस्टम प्रॉम्प्ट के साथ कॉल समाप्ति**

```
End the call when the user says goodbye, thank you, or indicates they have no more questions. You can only end the call after all their questions have been answered. Please end the call only after confirming that the user doesn't need any additional assistance.
```