What does this error mean and how do I fix it? Invalid ‘content’: array too long

Searched the forum, and Google, but cannot find a reason as to why I am seeing this error. “Error adding message: Invalid ‘content’: array too long. Expected an array with maximum length 10, but got an array with length 21 instead.”

2 Likes

Heya! Welcome to the dev forum.

Do you have more details?

Code we can see?

2 Likes

We already had another user report a similar error earlier today. The topic is gone but you are seemingly not the only one with this issue.

I agree with @PaulBellow that some sample code could help to look into things.

1 Like

Hi, Thanks for the welcome. No code. I am pasting the following into Playground Assistant that I created and get the aforementioned error:

Exodus is a Greek word that literally means “exit, departure, or going out.”
The Septuagint - an ancient Greek translation of the Old Testament - uses
this word to describe the book by its key event - Ex. 19:1, “gone out”. In Luke 9:31
and in 2 Peter 1:15, the word speaks of physical death of both Jesus and Peter, thus
echoing Exodus’s theme of redemption through death.
The Book of Exodus records Israel’s birth as a nation. During their time in Egypt,
one Hebrew family of seventy people rapidly multiplied. At the right time and accompanied by severe birth pains, the infant nation-numbering between two and three
million people-came into the world; and God protected, fed, and nurtured it.
The key figure in the Book of Exodus is Moses, a man who greatly doubted his
ability to lead God’s people, but who, nevertheless, remained steadfast in his com mitment to God. Although Moses was born into a Hebrew home, he grew up in an
Egyptian household with all the advantages of royalty. After a failed attempt to deliver
God’s people from Egyptian bondage by his own strength, he spent forty years in a
wilderness exile, where he received a thorough divine education.
To show Moses the seriousness of His plan, God called to him from the midst of a
burning bush that somehow did not burn up. In that remarkable encounter, the Lord
tasked a reluctant Moses with delivering His people from the Egyptians. So in Exodus, Moses sets out to fulfill his special calling: to lead the people of God out of harsh
bondage.
Themes: The Book of Exodus demonstrates twin themes of divine redemption and
deliverance. These themes are wonderfully demonstrated in Moses’ calling to lead the
people of Israel and in the ten plagues sent upon Egypt when Pharaoh refused to set
the Israelites free 7-11.

Yes- I saw that reported error in a Google Search, and it seems that it was deleted. I am not a coder. I just use API Playground.

1 Like

Ok. What model are you using?
Chat, Assistants, Completions?

You can use the share button to link to your conversation directly if that’s an option.

It looks like this screenshot.
I’m using gtp-4-turbo.

2 Likes

Also, the text input box becomes inoperable and I have to refresh the screen before I can paste in the prompt again, to duplicate the error (not sure if that’s pertinent).

1 Like

Looks like it might indeed be a bug. I’d reach out to help.openai.com to let them know.

OpenAI staff might see this, but perhaps not. Best to send it in with details if you can.

I’ll try to do that. Thanks for having a look. Have a great weekend.

1 Like

I’ll try to do that. Thanks for having a look. Have a great weekend.

1 Like

Apparently, the API interface didn’t like all of the extra paragraph returns in the pasted text. After deleting all the extra returns and re-pasting the text, all worked as it should.

1 Like

It was still definitely a bug, and you even provided enough info for it to be an easy fix for the devs! Nice job!

1 Like

@a115 I am having issue again can u tell me how t o fix?

I am having the issues. I am pasting in email content

	trump's legal problems
Daily update ⋅ 10 May 2024
NEWS	
Chuck Todd: Trump's legal woes are draining his coffers, but he's still stronger than Biden
YouTube
Chuck Todd sits down with James Hanson to discuss the upcoming US general election: the problems for both Biden and Trump, and how RFJ Jr could ...
Facebook	Twitter	Flag as irrelevant
Trump hush money trial: Michael Cohen awaits turn after Stormy Daniels account | AP News
AP News
Over more than 7½ hours of testimony, Daniels relayed in graphic detail what she says happened after the two met at a celebrity golf outing at ...
Facebook	Twitter	Flag as irrelevant
Michael Cohen Expected to Testify Monday at Trump Criminal Trial - Bloomberg
Bloomberg.com
Donald Trump's 2018 tweets defending a $130000 hush agreement with adult-film actress Stormy Daniels were shown to jurors at his criminal trial ...
Facebook	Twitter	Flag as irrelevant
Trump's Use of Campaign Funds to Pay Legal Bills | Brennan Center for Justice
Brennan Center for Justice
Since leaving office, former president Trump has been involved in an array of criminal and civil litigation — some that relates to his campaigns and ...

error is

Error adding message: Invalid 'content': array too long. Expected an array with maximum length 10, but got an array with length 24 instead.

I then have to refresh the browser to enable the prompt box

Playground. Busted.

image

I pasted 25 lines of text, and asked a single line question.

Also, had to right click and “paste without formatting” to get it to work at all, because the input box showed but completely ignored and didn’t submit text that had monospace metadata in the clipboard from copying from notepad++.

Good reason to write code for chat completions.

I am having the exact same problem. Cant copy and paste more than a few paragraphs without getting the same message and the UI completely breaking.

I have been trying to report the bug to support for 3 days and I just keep getting generic robotic responses like clear my cache.

Unusuable and frustrating.

I’m having exactly the same error. Doesn’t seem to matter what change for this. Though interestingly, I have found another part to the puzzle. I have successfully got one large copy and paste to work, but it doesn’t register it. You’ll notice I have pasted a large amount of text in the text box, when when I click run it only seems to register the very first line. Once the prompt is run and response returns, it has not registered any text after that initial line.

I do not know what the cause of this, but this in conjunction with the “Error adding message: Invalid ‘content’: array too long. Expected an array with maximum length 10, but got an array with length [number] instead” error, it is completely unusable for my purposes. Please get this fixed ASAP.

Apologies for the very low quality screenshots, new users are restricted.

Same issue here, It looked to me like an bug

For those who’s getting this problem but need a emergencial solution, you can use this online tool called textfixer (google it, can’t paste the URL)

1º paste your text
2º select “Remove ALL line breaks”
3º Copy and paste on Playground.

This will remove all tabs and line breaks, messing up with your code identation, but GPT will get it.

2 Likes