session

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package session provides a SQLite-based implementation of the ADK session.Service interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLiteService

type SQLiteService struct {
	// contains filtered or unexported fields
}

SQLiteService implements session.Service using SQLite for persistence.

func NewSQLiteService

func NewSQLiteService(dbPath string) (*SQLiteService, error)

NewSQLiteService creates a new SQLite-based session service. If dbPath is empty, it defaults to ~/.pumbaa/sessions.db

func (*SQLiteService) AppendEvent

func (s *SQLiteService) AppendEvent(ctx context.Context, sess session.Session, ev *session.Event) error

AppendEvent appends an event to a session.

func (*SQLiteService) Close

func (s *SQLiteService) Close() error

Close closes the database connection.

func (*SQLiteService) Create

Create creates a new session.

func (*SQLiteService) Delete

func (s *SQLiteService) Delete(ctx context.Context, req *session.DeleteRequest) error

Delete deletes a session.

func (*SQLiteService) Get

Get retrieves a session by ID.

func (*SQLiteService) List

List lists all sessions for a user.

func (*SQLiteService) ListWithSummaries added in v1.0.3

func (s *SQLiteService) ListWithSummaries(ctx context.Context, appName, userID string) ([]SessionInfo, error)

ListWithSummaries returns all sessions for a user with their summaries and metadata.

func (*SQLiteService) UpdateSummary added in v1.0.3

func (s *SQLiteService) UpdateSummary(ctx context.Context, sessionID, summary string) error

UpdateSummary updates the summary for a session.

func (*SQLiteService) UpdateTokenUsage added in v1.0.3

func (s *SQLiteService) UpdateTokenUsage(ctx context.Context, sessionID string, inputTokens, outputTokens int) error

UpdateTokenUsage updates the accumulated token counts for a session.

type SessionInfo added in v1.0.3

type SessionInfo struct {
	ID           string
	Summary      string
	CreatedAt    time.Time
	UpdatedAt    time.Time
	InputTokens  int
	OutputTokens int
	EventCount   int
}

SessionInfo contains summary information for displaying sessions in lists.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL