session

package
v0.8.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	ID        types.MessageID `firestore:"id" json:"id"`
	SessionID types.SessionID `firestore:"session_id" json:"session_id"`
	Type      MessageType     `firestore:"type" json:"type"`       // Type only affects Slack display method
	Content   string          `firestore:"content" json:"content"` // All stored as plain text
	CreatedAt time.Time       `firestore:"created_at" json:"created_at"`
	UpdatedAt time.Time       `firestore:"updated_at" json:"updated_at"`
}

Message represents a message recorded during a chat session

func NewMessage

func NewMessage(ctx context.Context, sessionID types.SessionID, msgType MessageType, content string) *Message

NewMessage creates a new session message

type MessageType

type MessageType string

MessageType represents the type of session message

const (
	MessageTypeTrace    MessageType = "trace"    // Progress messages displayed in context block
	MessageTypePlan     MessageType = "plan"     // Plan messages displayed in context block
	MessageTypeResponse MessageType = "response" // Final response displayed in normal block
	MessageTypeWarning  MessageType = "warning"  // Warning messages displayed in normal block
)

type Session

type Session struct {
	ID        types.SessionID     `firestore:"id" json:"id"`
	TicketID  types.TicketID      `firestore:"ticket_id" json:"ticket_id"`
	RequestID string              `firestore:"request_id" json:"request_id"`
	Status    types.SessionStatus `firestore:"status" json:"status"`
	UserID    types.UserID        `firestore:"user_id" json:"user_id"`
	Query     string              `firestore:"query" json:"query"`
	SlackURL  string              `firestore:"slack_url" json:"slack_url"`
	Intent    string              `firestore:"intent" json:"intent"`
	CreatedAt time.Time           `firestore:"created_at" json:"created_at"`
	UpdatedAt time.Time           `firestore:"updated_at" json:"updated_at"`
}

Session represents a chat session with its execution status

func NewSession

func NewSession(ctx context.Context, ticketID types.TicketID, userID types.UserID, query string, slackURL string) *Session

NewSession creates a new session with running status

func (*Session) UpdateIntent

func (s *Session) UpdateIntent(ctx context.Context, intent string)

UpdateIntent updates the session intent

func (*Session) UpdateStatus

func (s *Session) UpdateStatus(ctx context.Context, status types.SessionStatus)

UpdateStatus updates the session status

Jump to

Keyboard shortcuts

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