Versions in this module Expand all Collapse all v0 v0.6.0 Oct 30, 2026 Changes in this version + const MaxModelChars + const MaxPathChars + const MaxToolCallsPerRound + const MaxToolCallsTotal + const MaxToolOutputChars + const MaxToolRounds + const MaxTurnChars + const MaxTurns + const ProviderAnthropic + const ProviderGemini + const ProviderOpenAI + const ProviderOpenAICompatible + const ProviderUpstage + var ErrInvalidConversation = errors.New("assistant: invalid conversation") + var ErrInvalidSettings = errors.New("assistant: invalid settings") + var ErrKeyStorageUnavailable = errors.New("assistant: key storage unavailable") + var ErrNotConfigured = errors.New("assistant: not configured") + var ErrTimeout = errors.New("assistant: timed out") + var ErrUpstream = errors.New("assistant: llm request failed") + func LastUserQuestion(turns []Turn) string + func RedactSecrets(s string) string + func RequiresToolFirst(question string) bool + func SystemPrompt(page PageContext) string + func TruncateToolOutput(s string, max int) string + func ValidateSettings(s Settings) error + func ValidateTurns(turns []Turn) error + type Message struct + Content string + ProviderData []byte + Role Role + ToolCallID string + ToolCalls []ToolCall + type PageContext struct + Path string + func NewPageContext(path string) PageContext + type Protocol string + const ProtocolAnthropic + const ProtocolOpenAI + type Provider struct + DefaultBaseURL string + DefaultModel string + ID string + KeyRequired bool + Protocol Protocol + func ProviderByID(id string) (Provider, bool) + func Providers() []Provider + type Role string + const RoleAssistant + const RoleSystem + const RoleTool + const RoleUser + type Settings struct + APIKey string + BaseURL string + Enabled bool + KeyUnreadable bool + Model string + OrgID string + Provider string + UpdatedAt time.Time + UpdatedBy string + func (s Settings) EffectiveBaseURL() string + func (s Settings) EffectiveModel() string + func (s Settings) HasKey() bool + func (s Settings) KeyHint() string + func (s Settings) Ready() bool + func (s Settings) SameEndpoint(o Settings) bool + type ToolCall struct + Arguments string + ID string + Name string + ProviderData []byte + type ToolSpec struct + Description string + Name string + Parameters map[string]any + type ToolTrace struct + Name string + OK bool + type Turn struct + Content string + Role Role