> This is a page from the ElevenLabs documentation. For an index of the documentation, fetch https://elevenlabs.io/docs/llms.txt.

# चंकिंग ओवरराइड अपडेट करें

PATCH https://api.elevenlabs.io/v1/convai/knowledge-base/{documentation_id}/chunking-override
Content-Type: application/json

किसी दस्तावेज़ या फ़ोल्डर के लिए RAG चंकिंग ओवरराइड सेट या साफ़ करें।

Reference: https://elevenlabs.io/docs/eleven-agents/api-reference/knowledge-base/update-chunking-override

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Path parameters

- `documentation_id` (string, required) — नॉलेज बेस के किसी दस्तावेज़ की id। यह दस्तावेज़ जोड़ते समय लौटाई जाती है।

### Body (application/json)

This endpoint expects an object.

- `chunking_override` (ChunkingOverrideRequestModel, optional) — किसी दस्तावेज़ या फ़ोल्डर के लिए RAG चंकिंग ओवरराइड। Null ओवरराइड हटा देता है, ताकि पैरेंट और एम्बेडिंग मॉडल के डिफ़ॉल्ट लागू हों।

## Response

### 200

सफल रिस्पॉन्स

- `id` (string, required) — उस document या folder की ID जिसका chunking override अपडेट किया गया था।
- `reindex_queued` (boolean, required) — क्या प्रभावी कॉन्फ़िगरेशन बदला और बैकग्राउंड रीइंडेक्सिंग कतार में डाली गई।
- `chunking_override` (ChunkingOverride, optional) — लागू chunking override। Null का मतलब है कि entity अपने ancestors या embedding model के डिफ़ॉल्ट से inherit करती है।

## Errors

### 422 Documents Update Chunking Override Request Unprocessable Entity Error

वैलिडेशन एरर

- `detail` (list of ValidationError, optional)

## Types

### ChunkingOverrideRequestModel

- `max_chunk_size` (integer, optional) — टोकन में अधिकतम चंक आकार। null होने पर पूर्वजों या एम्बेडिंग मॉडल के डिफ़ॉल्ट से लिया जाता है।
- `overlap_percentage` (integer, optional) — Chunk overlap as a percentage of the final chunk size, applied after the chunk size is clamped to the embedding model. Null inherits from ancestors or the embedding model default.
- `custom_separators` (list of string, optional) — Custom text separators used when splitting. Null inherits from ancestors; an empty list clears inherited separators.

### ChunkingOverride

- `max_chunk_size` (integer, optional) — टोकन में अधिकतम चंक आकार। null होने पर इनहेरिट किया गया मान इस्तेमाल होता है।
- `overlap_percentage` (integer, optional) — Chunk overlap as a percentage of the chunk size. Null uses the inherited value.
- `custom_separators` (list of string, optional) — Custom text separators used when splitting. Null uses the inherited value.

### ValidationError

- `loc` (list of ValidationErrorLocItem, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItem

- string
- integer

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "21m00Tcm4TlvDq8ikWAM",
  "reindex_queued": true,
  "chunking_override": {
    "max_chunk_size": 800,
    "overlap_percentage": 10,
    "custom_separators": [
      "\n## "
    ]
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/convai/knowledge-base/21m00Tcm4TlvDq8ikWAM/chunking-override"

payload = {}
headers = {"Content-Type": "application/json"}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/convai/knowledge-base/21m00Tcm4TlvDq8ikWAM/chunking-override';
const options = {method: 'PATCH', headers: {'Content-Type': 'application/json'}, body: '{}'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.elevenlabs.io/v1/convai/knowledge-base/21m00Tcm4TlvDq8ikWAM/chunking-override"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.elevenlabs.io/v1/convai/knowledge-base/21m00Tcm4TlvDq8ikWAM/chunking-override")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.elevenlabs.io/v1/convai/knowledge-base/21m00Tcm4TlvDq8ikWAM/chunking-override")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.elevenlabs.io/v1/convai/knowledge-base/21m00Tcm4TlvDq8ikWAM/chunking-override', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/convai/knowledge-base/21m00Tcm4TlvDq8ikWAM/chunking-override");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/convai/knowledge-base/21m00Tcm4TlvDq8ikWAM/chunking-override")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```