Repository navigation
fix(smolagents): accept tuple inputs for messages, content parts, and task images - #912
SAMurai-16 wants to merge 6 commits into
Conversation
… task images - Support messages passed as tuples in to_input_messages - Support content parts passed as tuples in _parts_from_content - Support images passed as tuples in task_to_input_messages - Support stop sequences passed as tuples in _stop_sequences - Add unit tests in test_models and test_agents covering tuple inputs
Pull request dashboard statusWaiting on the author · refreshed 2026-11-01 09:15 UTC Respond to 1 review item (e.g. link a commit, explain why not, ask a follow-up):
Status above doesn't look right?
|
AgentGymLeader
left a comment
There was a problem hiding this comment.
Ran the smolagents latest and oldest envs on 4db5747: all pass. _stop_sequences has no tuple test: mlx_model(stop=("STOP",)) should record ("STOP",) as the stop sequences, and that assertion fails on main.
eternalcuriouslearner
left a comment
There was a problem hiding this comment.
Could we also add a streamed-generation test with tuple inputs? Both paths share request capture, so this would be additional regression coverage rather than a blocker.
|
Hi @SAMurai-16 — just a friendly reminder that this pull request is waiting on you. The dashboard status comment has the open items and is kept current.
|
|
Added |
Description
In
opentelemetry.instrumentation.genai.smolagents:to_input_messageshad an early returnif not isinstance(messages, list): return [], causing messages passed as tuples to be silently dropped._parts_from_contentonly checkedif isinstance(content, list):, dropping content parts passed as a tuple.task_to_input_messagescheckedif isinstance(images, list):, dropping images passed as a tuple._stop_sequencesinpatch.pycheckedif isinstance(stop, list):, dropping stop sequences passed as a tuple.This PR relaxes these collection checks to
(list, tuple)and updates the typing toSequence[...], consistent with PR fix(bedrock): accept tuple inputs #870 (bedrock) and PR fix(google-genai): handle tuple contents during capture #861 (google-genai).Fixes #905
Type of change
Please delete options that are not relevant.
How has this been tested?
opentelemetry-instrumentation-genai-smolagentspass.pre-commit/tox -e ruff.Checklist