#Why do I get only user messages but not bot?
6 messages · Page 1 of 1 (latest)
Sorry about that - currently debugging a possible regression - I'm assuming you're on version 0.9.0?
Try in 0.0.10
Works in 0.0.10. Thank you.
I first thought that this is expected behaviour
FYI "limit" prop is not available here anymore
return await ctx.runQuery(components.agent.messages.getThreadMessages, {
threadId,
limit: 100,
});
Ah yes that API changed to support pagination more easily. e.g.
export const getThreadMessages = query({
args: { threadId: v.string(), paginationOpts: paginationOptsValidator },
handler: async (ctx, { threadId, paginationOpts }) => {
const messages = await ctx.runQuery(
components.agent.messages.getThreadMessages,
{ threadId, paginationOpts },
);
return messages;
},
});
example: https://github.com/get-convex/agent/blob/main/example/convex/example.ts#L147-L156
So { threadId, paginationOpts: { cursor: null, numItems: 100 } } will do the same now if you're not paginating. Sorry it's more verbose