session.go

 1package proto
 2
 3// SelectedModelType represents the type of model selection (large or small).
 4type SelectedModelType string
 5
 6const (
 7	SelectedModelTypeLarge SelectedModelType = "large"
 8	SelectedModelTypeSmall SelectedModelType = "small"
 9)
10
11// SelectedModel represents a model selection with provider and configuration.
12type SelectedModel struct {
13	Model            string         `json:"model"`
14	Provider         string         `json:"provider"`
15	ReasoningEffort  string         `json:"reasoning_effort,omitempty"`
16	Think            bool           `json:"think,omitempty"`
17	MaxTokens        int64          `json:"max_tokens,omitempty"`
18	Temperature      *float64       `json:"temperature,omitempty"`
19	TopP             *float64       `json:"top_p,omitempty"`
20	TopK             *int64         `json:"top_k,omitempty"`
21	FrequencyPenalty *float64       `json:"frequency_penalty,omitempty"`
22	PresencePenalty  *float64       `json:"presence_penalty,omitempty"`
23	ProviderOptions  map[string]any `json:"provider_options,omitempty"`
24}
25
26// Session represents a session in the proto layer.
27type Session struct {
28	ID               string                              `json:"id"`
29	ParentSessionID  string                              `json:"parent_session_id"`
30	Title            string                              `json:"title"`
31	MessageCount     int64                               `json:"message_count"`
32	PromptTokens     int64                               `json:"prompt_tokens"`
33	CompletionTokens int64                               `json:"completion_tokens"`
34	SummaryMessageID string                              `json:"summary_message_id"`
35	Cost             float64                             `json:"cost"`
36	CreatedAt        int64                               `json:"created_at"`
37	UpdatedAt        int64                               `json:"updated_at"`
38	Models           map[SelectedModelType]SelectedModel `json:"models,omitempty"`
39}