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

LLM provider traces (e.g. OpenAI) don't handle images in the messages array #297

Open
willbakst opened this issue Jul 1, 2024 · 1 comment
Assignees
Labels
Bug Bug related to the Logfire Python SDK

Comments

@willbakst
Copy link
Contributor

Description

You can include images for vision with certain LLM provider APIs like OpenAI. The structure is slightly different and as a result it's not showing up in the UI. This also means that content sent in this structure won't show up even if it's just text.

Here is an example of the code that I would like to render images but instead only shows the raw json:

messages = [
    {"role": "user", "content": [{"type": "text", "text": "Recommend a book"}]
    {"role": "user", "content": [{"type": "image_url", {"url": "https://..."}}]
]

Neither of the above show up pretty in the UI like I would like. Taking a look at the code, it seems like this is because the UI only handles the non-list str messages array structure e.g. {"role": "user", "content": "Recommend a book"}

Python, Logfire & OS Versions, related packages (not required)

No response

@PauloFavero
Copy link

I have a similar issue when using the assistants and thread api's.

Log:Unable to instrument OpenAI API call: Expected options.json_data to be a dictionary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug related to the Logfire Python SDK
Projects
None yet
Development

No branches or pull requests

3 participants