Skip to main content

Module session

Module session 

Source
Expand description

Session management for the Agent system

This module defines types for managing conversation sessions. A session represents an ongoing conversation between a user and the agent.

§Architecture

Session
   ├── id (unique identifier)
   ├── title (display name)
   ├── messages[] (conversation history)
   ├── status (active/completed/error)
   └── timestamps (created/updated)

§Example

use codive_core::session::Session;
use codive_core::Message;

let mut session = Session::new();
session.add_message(Message::user("Hello!"));
session.add_message(Message::assistant_text("Hi there!"));

assert_eq!(session.message_count(), 2);

Structs§

Session
A conversation session between user and agent
SessionSummary
A lightweight summary of a session (for listings)

Enums§

SessionStatus
The current status of a session

Type Aliases§

SessionId
A unique identifier for a session