UseGetHistory
katanakit-js / useGetHistory
Function: useGetHistory()
Section titled “Function: useGetHistory()”function useGetHistory(sessionId): Promise< { content: string | null; name?: string; role: "system" | "user" | "assistant" | "tool"; tool_call_id?: string; tool_calls?: { function: { arguments: string; name: string; }; id: string; type: "function"; }[]; }[]>;Defined in: core/services/assistant.service.ts:313
Returns the full message history of a session, oldest first.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
sessionId |
string |
The conversation session id. |
Returns
Section titled “Returns”Promise<{
content: string | null;
name?: string;
role: "system" | "user" | "assistant" | "tool";
tool_call_id?: string;
tool_calls?: {
function: {
arguments: string;
name: string;
};
id: string;
type: "function";
}[];
}[]>
The accumulated messages.
Example
Section titled “Example”const history = await useGetHistory(sessionId);