Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Message ¶
type Message struct {
Role Role `json:"role"`
Content string `json:"content"`
ToolCalls []ToolCall `json:"tool_calls,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
Message — одно сообщение в диалоге
type Session ¶
type Session struct {
ID string `json:"id"`
Title string `json:"title"`
WorkDir string `json:"work_dir"`
Provider string `json:"provider"`
Model string `json:"model"`
Messages []Message `json:"messages"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Session — сессия диалога с AI
func (*Session) APIMessages ¶
APIMessages возвращает сообщения в формате для API (без tool results в отдельных полях)
func (*Session) AddMessage ¶
AddMessage добавляет сообщение в сессию
func (*Session) AddToolCall ¶
AddToolCall добавляет вызов инструмента к последнему сообщению ассистента
Click to show internal directories.
Click to hide internal directories.