Find answers from the community

Updated 2 months ago

Hey, everyone. I'm using a chat engine

Hey, everyone. I'm using a chat engine and when I ask for the bot to summarize the document like this: chat_engine.chat("Summarize this document for me: " + document). The document variable is a string that has a pdf document. It returns as an error: openai.BadRequestError: Error code: 400 - {'error': {'message': "Invalid 'messages': empty array. Expected an array with minimum length 1, but got an empty array instead.", 'type': 'invalid_request_error', 'param': 'messages', 'code': 'empty_array'}}
Can someone help me?
W
L
d
4 comments
Seems like something happened in llm step.

Correct me if I'm wrong, But does your document contains the entire pdf content in string format ?
if so then if summarization is the only requirement then you can do it directly with llm.

response = llm.complete("Summarize this document for me: " + document)
Yea would probably need to see a bit more code to debug this, pretty weird
Yes. It contains the entire pdf content in string format.
I've already solved it. Thank you so much guys.
Add a reply
Sign up and join the conversation on Discord