Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[smolagents] llm input messages are empty #1237

Open
andstor opened this issue Jan 29, 2025 · 2 comments · May be fixed by #1238
Open

[smolagents] llm input messages are empty #1237

andstor opened this issue Jan 29, 2025 · 2 comments · May be fixed by #1238
Assignees
Labels
bug Something isn't working language: python Related to Python integration

Comments

@andstor
Copy link
Contributor

andstor commented Jan 29, 2025

Describe the bug
huggingface/smolagents#220 modifies llm message contents from a simple string to a list of subcontent.

from:

messages = [
  {"role": "user", "content": "I'm doing great. How can I help you today?"},
]

to:

messages = [
  {"role": "user", "content": [{"type": "text", "text": "I'm doing great. How can I help you today?"},
{"type":"image"}
]

To Reproduce
Follow standard tutorial on huggingface.
https://github.com/huggingface/smolagents/blob/022947a2a587483ac897f403f52a1e0a50f53667/docs/source/en/tutorials/inspect_runs.md

This results in the following error:

Invalid type dict in attribute 'llm.input_messages.0.message.content' value sequence. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or None

Screenshots
Image
Image

@andstor andstor added bug Something isn't working triage Issues that require triage labels Jan 29, 2025
@andstor andstor changed the title [smolagents] MESSAGE_CONTENTS semantic convention not supported in Arize [smolagents] MESSAGE_CONTENTS semantic convention not supported in smollagents Jan 29, 2025
Copy link

dosubot bot commented Jan 29, 2025

Hey @andstor! I'm here to help you with any bugs, questions, or contributions you have for huggingface/smolagents. Let's tackle this issue together!

The error you're encountering is due to the change in the message content structure from a simple string to a list of subcontent dictionaries. The Arize Phoenix framework expects the llm.input_messages to be a list of objects where each message's content is a string, not a list of dictionaries [1].

To resolve this, you need to adjust the message content to match the expected structure. You can either:

  1. Convert the list of subcontent dictionaries into a single string before passing it to Arize Phoenix.
  2. Modify the processing logic in your application to handle the new structure if you have control over the Arize Phoenix integration.

If you need to maintain the new structure for other parts of your application, consider creating a separate processing step specifically for compatibility with Arize Phoenix.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot dosubot bot added the language: python Related to Python integration label Jan 29, 2025
@andstor andstor changed the title [smolagents] MESSAGE_CONTENTS semantic convention not supported in smollagents [smolagents] llm input messages are empty Jan 29, 2025
@nate-mar
Copy link
Contributor

Thanks for reporting! Working on a fix for this. Hang tight! :D

@nate-mar nate-mar assigned nate-mar and unassigned andstor Jan 30, 2025
@mikeldking mikeldking removed the triage Issues that require triage label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working language: python Related to Python integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants