Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetachContext ¶
DetachContext returns a new context that is independent of the parent's cancellation and deadline but preserves all context values. Use this when spawning long-running goroutines that must not be cancelled when the originating request completes.
func EstimateTokens ¶
EstimateTokens returns a character-based token count approximation. ASCII/Latin characters are counted as 1 token per 4 characters. CJK characters (Chinese, Japanese, Korean) are counted as 1 token per 2 characters.
Types ¶
type ChannelType ¶
type ChannelType string
ChannelType represents a messaging platform channel type.
const ( ChannelTelegram ChannelType = "telegram" ChannelDiscord ChannelType = "discord" ChannelSlack ChannelType = "slack" )
func (ChannelType) Valid ¶
func (c ChannelType) Valid() bool
Valid reports whether c is a known channel type.
func (ChannelType) Values ¶
func (c ChannelType) Values() []ChannelType
Values returns all known channel types.
type Confidence ¶
type Confidence string
Confidence represents a confidence level for analysis results.
const ( ConfidenceHigh Confidence = "high" ConfidenceMedium Confidence = "medium" ConfidenceLow Confidence = "low" )
func (Confidence) Valid ¶
func (c Confidence) Valid() bool
Valid reports whether c is a known confidence level.
func (Confidence) Values ¶
func (c Confidence) Values() []Confidence
Values returns all known confidence levels.
type ContentCallback ¶
ContentCallback is an optional hook called when content is saved, enabling asynchronous processing without importing external packages.
type EmbedCallback ¶
EmbedCallback is an optional hook called when content is saved, enabling asynchronous embedding without importing the embedding package.
type Enum ¶
Enum defines a common interface for typed enum values. Each enum type should implement Valid() and Values() as value receiver methods.
type MessageRole ¶
type MessageRole string
MessageRole represents the role of a message participant.
const ( RoleUser MessageRole = "user" RoleAssistant MessageRole = "assistant" RoleTool MessageRole = "tool" RoleFunction MessageRole = "function" RoleModel MessageRole = "model" )
func (MessageRole) Normalize ¶
func (r MessageRole) Normalize() MessageRole
Normalize converts legacy role names to their canonical forms. "model" becomes "assistant", "function" becomes "tool". All other roles are returned as-is.
func (MessageRole) Valid ¶
func (r MessageRole) Valid() bool
Valid reports whether r is a known message role.
func (MessageRole) Values ¶
func (r MessageRole) Values() []MessageRole
Values returns all known message roles.
type ProviderType ¶
type ProviderType string
ProviderType represents an LLM provider type.
const ( ProviderOpenAI ProviderType = "openai" ProviderAnthropic ProviderType = "anthropic" ProviderGemini ProviderType = "gemini" ProviderGoogle ProviderType = "google" ProviderOllama ProviderType = "ollama" ProviderGitHub ProviderType = "github" )
func (ProviderType) Valid ¶
func (p ProviderType) Valid() bool
Valid reports whether p is a known provider type.
func (ProviderType) Values ¶
func (p ProviderType) Values() []ProviderType
Values returns all known provider types.
type RPCSenderFunc ¶
RPCSenderFunc defines how to send an RPC request to a remote provider.
type TripleCallback ¶
type TripleCallback func(triples []Triple)
TripleCallback is an optional hook for saving graph triples.