Skip to content

ListSessions

Source: src/AWS/BedrockAgentCore/ListSessions.ts

Lists an actor’s sessions in a memory.

Bind a Memory inside a function runtime to enumerate the sessions an actor has recorded events under. Provide AgentCore.ListSessionsHttp on the Function effect to implement the binding.

// init
const listSessions = yield* AgentCore.ListSessions(memory);
return {
fetch: Effect.gen(function* () {
// runtime
const result = yield* listSessions({ actorId: "user-1" });
return HttpServerResponse.json({
count: result.sessionSummaries.length,
});
}),
};