Skip to content
Changelog

Fixes for AgenticChunking, BaiduSearchTools and Mistral

October 22, 20261 min read

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.

# 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, and learn more about 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.

# 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, and learn more about BaiduSearchTools 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.

# 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, and learn more about Mistral models and the Mistral embedder in the documentation.

Frequently asked questions

When the chunking model answered with 0 or a negative position, earlier releases sliced nothing off the text and asked the model again, forever. AgenticChunking now uses max_chunk_size whenever the model returns a position of 0 or below.

The tool serialized results with json.dumps defaults, which escape every non-ASCII character. It now passes ensure_ascii=False, so titles and abstracts reach the model and the logs as Chinese characters in the same JSON structure.

Pass timeout in seconds and endpoint as a URL. Agno hands them to the mistralai client as timeout_ms and server_url, on MistralChat and MistralEmbedder alike. Values in client_params still take precedence.

Use safe_prompt=True. safe_mode=True still works as a deprecated alias that sends safe_prompt=True and emits a DeprecationWarning.

Shipped around the same time