- internal/llama/template.go: ChatML/Llama3 template engine with stop tokens - internal/agent/reasoning.go: parse <think>/<reasoning> tags from LLM output - companion/promptbuilder.go: output structured BuildResult, add date/time context - agent/agent.go: wire templates + reasoning split into message loop - storage: add reasoning TEXT column to messages table + migration - channel/tui.go: collapsible reasoning (tab toggle), mouse scroll, polished dimmed style - config: CHAT_TEMPLATE env var (chatml|llama3|none) - plan.md: mark Phase 2 complete, add themes TODO
59 lines
1.2 KiB
Go
59 lines
1.2 KiB
Go
package types
|
|
|
|
import "time"
|
|
|
|
type Role string
|
|
|
|
const (
|
|
RoleUser Role = "user"
|
|
RoleAssistant Role = "assistant"
|
|
RoleSystem Role = "system"
|
|
RoleTool Role = "tool"
|
|
)
|
|
|
|
type Message struct {
|
|
ID string `json:"id"`
|
|
Role Role `json:"role"`
|
|
Content string `json:"content"`
|
|
Reasoning string `json:"reasoning,omitempty"`
|
|
ToolCall *ToolCall `json:"toolCall,omitempty"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
}
|
|
|
|
type ToolCall struct {
|
|
Name string `json:"name"`
|
|
Arguments string `json:"arguments"`
|
|
Result string `json:"result,omitempty"`
|
|
}
|
|
|
|
type Conversation struct {
|
|
ID string `json:"id"`
|
|
Messages []Message `json:"messages"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
type SegmentType string
|
|
|
|
const (
|
|
SegSystem SegmentType = "system"
|
|
SegUser SegmentType = "user"
|
|
SegAssistant SegmentType = "assistant"
|
|
)
|
|
|
|
type PromptSegment struct {
|
|
Type SegmentType
|
|
Content string
|
|
}
|
|
|
|
type Mood string
|
|
|
|
const (
|
|
MoodNeutral Mood = "neutral"
|
|
MoodCurious Mood = "curious"
|
|
MoodPlayful Mood = "playful"
|
|
MoodThoughtful Mood = "thoughtful"
|
|
MoodAnnoyed Mood = "annoyed"
|
|
MoodTired Mood = "tired"
|
|
)
|