I’m using this example code from the api reference:
import OpenAI from "openai";
const secretKey = process.env.OPENAI_API_KEY;
const openai = new OpenAI({
apiKey: secretKey,
});
async function main() {
const threadMessages = await openai.beta.threads.messages.list(
"thread_Vq6jODhz4MMCLREefGCalAQc"
);
console.log(threadMessages.data);
}
main();
and the response shows up like this
[
{
id: 'msg_dqdJfsA9P8LS6HGGLc6UTV19',
object: 'thread.message',
created_at: 1699890178,
thread_id: 'thread_Vq6jODhz4MMCLREefGCalAQc',
role: 'assistant',
content: [ [Object] ],
file_ids: [],
assistant_id: 'asst_KY63Cucqs8pIXeRcoeJmEYq1',
run_id: 'run_3RdB35oXNjCIEaOj5l1sATP1',
metadata: {}
},
{
id: 'msg_dBLzGTjaNYcYriIdHHTxPQ90',
object: 'thread.message',
created_at: 1699890174,
thread_id: 'thread_Vq6jODhz4MMCLREefGCalAQc',
role: 'assistant',
content: [ [Object] ],
file_ids: [],
assistant_id: 'asst_KY63Cucqs8pIXeRcoeJmEYq1',
run_id: 'run_3RdB35oXNjCIEaOj5l1sATP1',
metadata: {}
},
{
id: 'msg_9RJ4soRUk4kgiz3iAHrkshkb',
object: 'thread.message',
created_at: 1699890170,
thread_id: 'thread_Vq6jODhz4MMCLREefGCalAQc',
role: 'user',
content: [ [Object] ],
file_ids: [],
assistant_id: null,
run_id: null,
metadata: {}
}
]
Why does the text show up as [Object]? I want to just see the plain text.
Any help would be appreciated