Unable to retrieve generated files from Assistants API

This used to work before the gpt-4o launch, but now we are not seeing any file attachments for generated files with Code Interpreter.

Repro Steps:

Prompt:

Generate a CSV with all 50 US states.

Logs:

import pandas as pd
# List of all US states
states = [
"Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado",
"Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho",
"Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana",
"Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota",
"Mississippi", "Missouri", "Montana", "Nebraska", "Nevada",
"New Hampshire", "New Jersey", "New Mexico", "New York",
"North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon",
"Pennsylvania", "Rhode Island", "South Carolina",
"South Dakota", "Tennessee", "Texas", "Utah", "Vermont",
"Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"
]
# Create a DataFrame
df_states = pd.DataFrame(states, columns=['State'])
# Save DataFrame to CSV
csv_path = "/mnt/data/US_States.csv"
df_states.to_csv(csv_path, index=False)
The CSV file containing all 50 US states has been created. You can download it using the link below:

Retrieve all messages from openai.beta.threads.messages.list

SyncCursorPage[Message](
    data=[
        Message(
            id='msg_s9WPnzqF8xxxxxxxxxxxxx',
            assistant_id='asst_ndcMgmxxxxxxxxxxxxx',
            attachments=[],
            completed_at=None,
            content=[
                TextContentBlock(
                    text=Text(
                        annotations=[],
                        value='The CSV file containing all 50 US states has been created. You can download it using the link below:\n\n[Download US States
CSV](sandbox:/mnt/data/US_States.csv)'
                    ),
                    type='text'
                )
            ],
            created_at=1715719138,
            incomplete_at=None,
            incomplete_details=None,
            metadata={},
            object='thread.message',
            role='assistant',
            run_id='run_YnT0xxxxxxxxxxxxx',
            status=None,
            thread_id='thread_ntw4xxxxxxxxxxxxx'
        ),
        Message(
            id='msg_aAgUWCpxxxxxxxxxxxxx',
            assistant_id=None,
            attachments=[],
            completed_at=None,
            content=[TextContentBlock(text=Text(annotations=[], value='Generate a CSV with all 50 US states.'), type='text')],
            created_at=1715719114,
            incomplete_at=None,
            incomplete_details=None,
            metadata={},
            object='thread.message',
            role='user',
            run_id=None,
            status=None,
            thread_id='thread_ntw4aiXxxxxxxxxxxxxx'
        )
    ],
    object='list',
    first_id='msg_s9WPnzqF8Qaxxxxxxxxxxxxx',
    last_id='msg_aAgUWCppWBxxxxxxxxxxxxx',
    has_more=False
)

I’m using gpt-4o by the way.

As you can see, attachments and also annotations is empty, did something change in the way to retrieve files?

1 Like

I’ve encountered the exact same issue where output file attachments are not appearing in generated responses. It happens with all models.

The weird thing is, this problem is inconsistent across different environments. In one environment, file paths and attachments are correctly included in the responses, while in another, they are consistently missing.

Has anyone else experienced this issue or found a solution? Any insights or suggestions would be greatly appreciated.

What do you mean by environment? I’ve also tried all models and the issue is indeed the same across all models and started happening after gpt-4o launch this week.

By “environment,” I mean the specific OpenAI organization or subscription. I am working with two different organizations/subscriptions, and the issue only occurs with one of them. The other organization works perfectly fine.

1 Like

Oh wow, I just tried another API key from another OpenAI account and it works!

1 Like

Hmmm… I am encountering this issue as well, which was not the case with previous Assistant API. I will try to switch Organization/Project and report back to see if that also worked for me. I’m surprised there’s not more talk about this?