mirror of
https://github.com/ollama/ollama.git
synced 2026-10-20 18:41:17 +00:00
The [img] placeholders mixed internal markers into tool text: the native llama-server path sends them as literal text, so an image-only result gained a text part, and tool output containing [img] or [img-N] moved or dropped image tags. api.Message cannot carry image positions without in-band markers, so stop merging tool results that include images. Text-only tool results, the only array form the Chat Completions spec allows for tool messages, are still merged into one message (now with a strings.Builder). Results with images keep the per-part split in order, which preserves image positions, with the tool call id and name set on every part. |
||
|---|---|---|
| .. | ||
| openai.go | ||
| openai_encoding_format_test.go | ||
| openai_test.go | ||
| responses.go | ||
| responses_compact.go | ||
| responses_compact_names_test.go | ||
| responses_compact_test.go | ||
| responses_test.go | ||
| thinking_test.go | ||