Documentation
¶
Index ¶
- Constants
- func ResolvePluginSessionName(cfg PluginConfig, input SessionNameInput) string
- type ConfigEvidence
- type PluginAsyncResult
- type PluginAsyncWriter
- type PluginConfig
- type PluginConfigInput
- type PluginMemoryMessage
- type PluginMemorySession
- type PluginPeerInput
- type PluginPeerResolution
- type PluginSessionFlusher
- type PluginSessionFlusherFunc
- type PluginWriteFrequency
- type PluginWriteResult
- type PluginWriteRouter
- type PluginWriteRouterConfig
- type SessionNameInput
- type WriteFrequencyMode
Constants ¶
View Source
const ( LocalHonchoAPIKeySentinel = "local" GonchoConfigBaseURLInvalid = "goncho_config_base_url_invalid" GonchoConfigLocalBaseURL = "goncho_config_local_base_url" )
View Source
const ( GonchoWriteFlushed = "goncho_write_flushed" GonchoWriteDeferred = "goncho_write_deferred" GonchoWriteQueued = "goncho_write_queued" GonchoWriteFlushFailed = "goncho_write_flush_failed" GonchoAsyncEnqueued = "goncho_async_enqueued" GonchoAsyncFlushed = "goncho_async_flushed" GonchoAsyncRetry = "goncho_async_retry" GonchoAsyncFlushFailed = "goncho_async_flush_failed" GonchoAsyncShutdown = "goncho_async_shutdown" GonchoAsyncClosed = "goncho_async_closed" )
Variables ¶
This section is empty.
Functions ¶
func ResolvePluginSessionName ¶
func ResolvePluginSessionName(cfg PluginConfig, input SessionNameInput) string
Types ¶
type ConfigEvidence ¶
type PluginAsyncResult ¶
func (PluginAsyncResult) HasEvidence ¶
func (r PluginAsyncResult) HasEvidence(code string) bool
type PluginAsyncWriter ¶
type PluginAsyncWriter struct {
// contains filtered or unexported fields
}
func NewPluginAsyncWriter ¶
func NewPluginAsyncWriter(flusher PluginSessionFlusher) *PluginAsyncWriter
func (*PluginAsyncWriter) Cache ¶
func (w *PluginAsyncWriter) Cache(session PluginMemorySession)
func (*PluginAsyncWriter) Enqueue ¶
func (w *PluginAsyncWriter) Enqueue(session PluginMemorySession) PluginAsyncResult
func (*PluginAsyncWriter) FlushAll ¶
func (w *PluginAsyncWriter) FlushAll() PluginAsyncResult
func (*PluginAsyncWriter) Shutdown ¶
func (w *PluginAsyncWriter) Shutdown() PluginAsyncResult
type PluginConfig ¶
type PluginConfig struct {
Host string
WorkspaceID string
APIKey string
APIKeySource string
Environment string
BaseURL string
PeerName string
AIPeer string
PinPeerName bool
Enabled bool
SaveMessages bool
WriteFrequency PluginWriteFrequency
SessionStrategy string
SessionPeerPrefix bool
Sessions map[string]string
Raw map[string]any
Evidence []ConfigEvidence
}
func ResolvePluginConfig ¶
func ResolvePluginConfig(input PluginConfigInput) PluginConfig
func (PluginConfig) HasEvidence ¶
func (c PluginConfig) HasEvidence(code string) bool
type PluginConfigInput ¶
type PluginMemoryMessage ¶
type PluginMemorySession ¶
type PluginMemorySession struct {
Key string
UserPeerID string
AssistantPeerID string
HonchoSessionID string
Messages []PluginMemoryMessage
}
type PluginPeerInput ¶
type PluginPeerInput struct {
Config PluginConfig
RuntimeUserPeerName string
SessionKey string
}
type PluginPeerResolution ¶
func ResolvePluginPeerNames ¶
func ResolvePluginPeerNames(input PluginPeerInput) PluginPeerResolution
type PluginSessionFlusher ¶
type PluginSessionFlusher interface {
FlushPluginSession(PluginMemorySession) error
}
type PluginSessionFlusherFunc ¶
type PluginSessionFlusherFunc func(PluginMemorySession) error
func (PluginSessionFlusherFunc) FlushPluginSession ¶
func (f PluginSessionFlusherFunc) FlushPluginSession(session PluginMemorySession) error
type PluginWriteFrequency ¶
type PluginWriteFrequency struct {
Mode WriteFrequencyMode
Every int
Raw string
}
func ParsePluginWriteFrequency ¶
func ParsePluginWriteFrequency(raw any) PluginWriteFrequency
type PluginWriteResult ¶
type PluginWriteRouter ¶
type PluginWriteRouter struct {
// contains filtered or unexported fields
}
func NewPluginWriteRouter ¶
func NewPluginWriteRouter(cfg PluginWriteRouterConfig) *PluginWriteRouter
func (*PluginWriteRouter) Save ¶
func (r *PluginWriteRouter) Save(session PluginMemorySession) PluginWriteResult
type PluginWriteRouterConfig ¶
type PluginWriteRouterConfig struct {
Frequency PluginWriteFrequency
Flusher PluginSessionFlusher
AsyncWriter *PluginAsyncWriter
}
type SessionNameInput ¶
type WriteFrequencyMode ¶
type WriteFrequencyMode string
const ( WriteFrequencyInvalid WriteFrequencyMode = "invalid" WriteFrequencyAsync WriteFrequencyMode = "async" WriteFrequencyTurn WriteFrequencyMode = "turn" WriteFrequencySession WriteFrequencyMode = "session" WriteFrequencyEvery WriteFrequencyMode = "every" )
Click to show internal directories.
Click to hide internal directories.