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

# chunk • AI Agent SDK

> chunk: Chunk text using the configured chunking strategy.

# chunk

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**Chunking**](../classes/Chunking) class in the [**chunking**](../modules/chunking) module.

Chunk text using the configured chunking strategy.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def chunk(text: Union[str, List[str]]) -> Union[List[Any], List[List[Any]]]
```

## Parameters

<ParamField query="text" type="Union" required={true}>
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="Union[List[Any], List[List[Any]]]">
  The result of the operation.
</ResponseField>

## Uses

* `chunker`
* `warnings.warn`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/knowledge/chunking.py#L158">
  `praisonaiagents/knowledge/chunking.py` at line 158
</Card>
