| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| langroid-0.65.10-py3-none-any.whl | 2026-07-23 | 454.2 kB | |
| langroid-0.65.10.tar.gz | 2026-07-23 | 403.7 kB | |
| 0.65.10 source code.tar.gz | 2026-07-23 | 58.8 MB | |
| 0.65.10 source code.zip | 2026-07-23 | 59.2 MB | |
| README.md | 2026-07-23 | 2.5 kB | |
| Totals: 5 Items | 118.9 MB | 0 | |
0.65.10 — Faithful "no content" for LLM messages (fixes Gemini 3.x tool calls)
This release fixes tool calls with Gemini 3.x models (e.g.
gemini-3.5-flash-lite, gemini-3.6-flash) on Vertex AI, originally
diagnosed and fixed by @alexagr. Langroid now
carries an assistant turn's "no content" faithfully as None instead of
padding it to a single space, so tool-call turns no longer trip Gemini's
400 INVALID_ARGUMENT.
:::bash
pip install -U langroid
The bug — a padded space breaks Gemini 3.x tool calls (#1062)
An assistant turn that is only a tool/function call has no text content.
ChatDocument.to_LLMMessage padded such empty content with a single space
(" ") "because some LLM APIs don't like an empty msg", so every stored
tool-call turn carried content=" ".
Gemini 3.x rejects an assistant turn that has both a tool/function call
and non-empty text content with 400 INVALID_ARGUMENT — breaking every
conversation on the turn that sends a tool result back to the model.
The fix — carry the response shape faithfully, don't fabricate content
Langroid now distinguishes "missing" (None, omitted on the wire) from
"present-but-empty" ("") end to end:
LLMResponse.messageis nowOptional[str]; a tool-only response keepsmessage=Nonerather than being coerced to"".ChatDocumentgains an explicitcontent_is_noneflag (thecontentfield itself stays a mandatorystr), which is authoritative when reconstructing the message — a serialized/round-tripped tool-call turn cannot resurrect stale text alongside its calls.ChatDocument.to_LLMMessagereproduces "no content" asLLMMessage.content=None(nowOptional[str]) instead of" ".LLMMessage.api_dictdropsNonecontent from the payload, and pads a lone space only when a message would otherwise be entirely empty (no content and no tool/function call) — the case older Gemini models reject.
None-safety guards were added for the consumers of the now-optional fields
(token counting, truncation, display callbacks, cached-response replay), with
regression tests across the LLMResponse → ChatDocument → LLMMessage
pipeline for both the tool_calls and legacy function_call shapes.
No action needed for existing code — this is a transparent fix. If you use Gemini 3.x models on Vertex AI with tools, they now work.
Full Changelog: https://github.com/langroid/langroid/compare/0.65.9...0.65.10