Skip to content

fix(examples): record multi-tool assistant messages once - #757

Open
beyondsundial wants to merge 2 commits into
ollama:mainfrom
beyondsundial:contrib/multi-tool-assistant-history
Open

beyondsundial wants to merge 2 commits into
ollama:mainfrom
beyondsundial:contrib/multi-tool-assistant-history

Conversation

@beyondsundial

Copy link
Copy Markdown

When one streamed chunk contains multiple tool calls, multi-tool.py repeats the same assistant message before each result. Record it once before processing the calls, preserving one tool result per call.

Add a mocked example test that checks the next request's message order for one and two tools, plus the no-tool case.

Validation: pytest ollama tests -q (123 passed), and Ruff lint/format checks on both changed files, using Python 3.12.14.

Prepared with AI assistance and verified locally; pending the submitter's review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant