Skip to main content

getChatMessages()

getChatMessages(projectId: string, chatId: string): Promise<ProjectChatMessage[]>

Defined in: packages/core/src/index.ts:2267

Get messages from a project chat

Parameters

ParameterTypeDescription
projectIdstringThe unique identifier of the project
chatIdstringThe unique identifier of the chat

Returns

Promise<ProjectChatMessage[]>

Array of chat messages

Throws

401 - Not authenticated

Throws

404 - Project or chat not found

Example

import { getChatMessages } from "@cpod/sdk";

const messages = await getChatMessages("project-123", "chat-456");
messages.forEach(msg => {
console.log(`${msg.role}: ${msg.content}`);
});