Help! I am using Assistant API to get a table output but Separator row in table is being considered as table data row

Hi all,
I am using Assistant API in my web based application. but due to some issue, Separator row in the table is being considered as table data row

This is my query to the Assistant API:
“Create a table showing the names and populations of the three most populous countries in the world.”

And this is what I get as a response from API:
“Sure, here’s a table showing the names and populations of the three most populous countries in the world:\n\n| Country | Population (in billions) |\n| ------------ | ------------------------ |\n| China | 1.41 |\n| India | 1.39 |\n| United States| 0.33 |”

Then I am using python’s textile library to convert this text to HTML format so that I can display it in my application. After converting the text to HTML using textile library, I get this output:

‘\t

Sure, here’s a table showing the names and populations of the three most populous countries in the world:

\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t
Country Population (in billions)
—————— ————————————
China 1.41
India 1.39
United States 0.33

After this, I add some CSS styles so that the table looks good but the separator line between header row and 1st data row of the table is also being considered as a row. As shown in the screenshot below

have you tried asking to the ai for not adding that separator? like just the table and nothing else?

Certainly, I’ve included instructions for that during the creation of the Assistant, as well as in the process of setting up the Run. However, it seems that it’s not functioning as intended.

Hey, I ran into a hiccup with the Assistant API, but I’ve been working on it. Cleaned up the table structure and tried a few different ways of asking ChatGPT. Also, threw in some clear instructions like “You’re an assistant pulling info from tables; first row’s a separator.” Checked for typos and errors too. Fingers crossed these tweaks make things better! :crossed_fingers:

1 Like