# Fixes for AgenticChunking, BaiduSearchTools and Mistral

> Agno's AgenticChunking no longer hangs on a breakpoint of 0, BaiduSearchTools returns readable Chinese results, and MistralChat and MistralEmbedder accept their timeout, endpoint and safe_mode settings.

- Published: 2026-10-22
- Author: Md. Fazlul Karim
- Categories: Changelog
- Canonical: https://www.agno.com/blog/fixes-for-agenticchunking-baidusearchtools-and-mistral
- Markdown: https://www.agno.com/blog/fixes-for-agenticchunking-baidusearchtools-and-mistral.md

Three fixes touch Agno's `AgenticChunking`, `BaiduSearchTools`, and the `MistralChat` and `MistralEmbedder` classes. We reproduced each on this release and the previous one with stand-ins for the model, the search engine and the Mistral API, so no request left the machine.

## AgenticChunking falls back on a bad breakpoint

`AgenticChunking.chunk()` asks a model where to split the text and slices there. A reply of `0` sliced off an empty chunk and left the text as it was, so the loop asked the same question until something killed the process. A negative reply stalled the same way once it reached the tail of the text. Any position of 0 or below now falls back to `max_chunk_size`, and the constructor rejects a `max_chunk_size` of 0 or less.

A scripted stand-in model, patched in through `get_model` the way the release's own tests do it, answered `0` to every request.

```text
# real output, scripted stand-in model that always answers "0"
# AgenticChunking(max_chunk_size=500) on 1,200 characters

Before  still chunking after 10 s, 2,060,431 model calls so far, gave up
Now     3 chunks, sizes [500, 500, 200], model calls 3

AgenticChunking(max_chunk_size=0)
Before  accepted
Now     ValueError: `max_chunk_size` must be greater than 0
```

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/07_knowledge/09_archive/chunking/agentic_chunking.py), and learn more about [agentic chunking](https://docs.agno.com/knowledge/concepts/chunking/agentic-chunking) in the documentation.

## BaiduSearchTools keeps Chinese readable

`BaiduSearchTools.baidu_search()` now calls `json.dumps` with `ensure_ascii=False`. Python escapes every non-ASCII character by default, so a Chinese title reached the model and the debug log as a run of `\u` codes, about six characters for each one it replaced. The result is still JSON with the same fields.

```text
# real output, baidusearch.search mocked to return one Chinese result

Before
"title": "\u767e\u5ea6\u4e00\u4e0b\uff0c\u4f60\u5c31\u77e5\u9053",
"abstract": "\u5168\u7403\u9886\u5148\u7684\u4e2d\u6587\u641c\u7d22\u5f15\u64ce",

Now
"title": "百度一下，你就知道",
"abstract": "全球领先的中文搜索引擎",
```

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/91_tools/baidusearch_tools.py), and learn more about [BaiduSearchTools](https://docs.agno.com/tools/toolkits/search/baidusearch) in the documentation.

## Mistral settings reach the SDK

`MistralChat` passed `timeout` and `endpoint` to the `mistralai` client under names its constructor rejects, so `get_client()` raised a `TypeError` before the first request. Agno now maps `endpoint` to the SDK's `server_url` and `timeout`, in seconds, to `timeout_ms`, and `MistralEmbedder` does the same with `endpoint`. `safe_mode=True` now sends `safe_prompt=True`, the only name the chat methods accept, and warns that `safe_mode` is deprecated. `max_retries` is deprecated too and ignored, because the SDK limits retries by elapsed time; use `retries=` or a `RetryConfig` in `client_params`.

```text
# real output, dummy API key, clients built locally with no request sent

MistralChat(timeout=5).get_client()
Before  TypeError: Mistral.__init__() got an unexpected keyword argument 'timeout'
Now     ok

MistralChat(endpoint="https://example.test", timeout=5).get_client()
Before  TypeError: Mistral.__init__() got an unexpected keyword argument 'endpoint'
Now     server_url=https://example.test timeout_ms=5000

MistralEmbedder(endpoint="https://example.test", timeout=5).client
Before  TypeError: Mistral.__init__() got an unexpected keyword argument 'endpoint'
Now     server_url=https://example.test timeout_ms=5000

MistralChat(safe_mode=True) request params, bound to chat.complete's signature
Before  TypeError: got an unexpected keyword argument 'safe_mode'
Now     {'safe_prompt': True}
        DeprecationWarning: MistralChat.safe_mode is deprecated; use safe_prompt=True instead.
```

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/90_models/mistral/basic.py), and learn more about [Mistral models](https://docs.agno.com/models/providers/native/mistral/overview) and the [Mistral embedder](https://docs.agno.com/knowledge/concepts/embedder/mistral/mistral-embedder) in the documentation.
