For the past week or so, I have had a functional workflow using the Assistants API until about midday today. The workflow is simply creating a thread, adding a message with a csv file attached for the code_interpreter, the starting a run with an assistant to create a plot of the data. This was working fine, until earlier today when the runs started failing with:
last_error=LastError(code='server_error', message='Sorry, something went wrong.')
The weird thing is occasionally, the run successfully plots the data, and creates the image, but then still fails. I have recreated this problem in Playground:
User
Please plot this data
sample_data.csv
code_interpreter
import pandas as pd
# Load the dataset
file_path = '/mnt/data/file-WANYwjyFvte3AU144NPNoh'
df = pd.read_csv(file_path)
# Display the first few rows of the dataframe
df.head()
Visualization Assistant
The dataset contains the following columns: ID, Name, Age, Country, and Score. Here is a preview of the first few rows:
ID: A unique identifier for each entry.
Name: The name of the individual.
Age: The age of the individual.
Country: The country of the individual.
Score: Some sort of score related to the individual.
Now, let's visualize this data. A good starting point would be to create a bar chart of the average scores for each country. Shall we proceed with that?
User
yes
code_interpreter
import matplotlib.pyplot as plt
import seaborn as sns
# Calculate average scores for each country
country_avg_scores = df.groupby('Country')['Score'].mean().reset_index()
# Set the visual style
sns.set_theme(style="whitegrid")
# Create a bar plot
plt.figure(figsize=(10, 6))
sns.barplot(data=country_avg_scores, x='Country', y='Score', palette='viridis')
# Set the labels and title
plt.title('Average Scores by Country', fontsize=16)
plt.xlabel('Country', fontsize=12)
plt.ylabel('Average Score', fontsize=12)
plt.xticks(rotation=45)
# Save the plot as a PNG image
output_path = '/mnt/data/average_scores_by_country.png'
plt.savefig(output_path)
plt.show()
output_path
Image
Visualization Assistant
file-A3cuvpKe5rCVP5bMZmF2HP
Here is the bar chart showing the average scores grouped by country. You can download the image here. If you need further analysis or a different type of visualization, feel free to let me know!
Run failed
Sorry, something went wrong.
The dataset is very small, and is properly formatted. I have not changed the code I was using from when the workflow was working properly. I am not hitting rate limits, or usage limits that I know of. My code worked like 5 hours ago. Really not sure what to do here with the lack of detail given from the error messages.