Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelConfig ¶ added in v0.3.0
type ChannelConfig struct {
Enable bool `json:"enable,omitempty" yaml:"enable,omitempty"`
Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` // "websocket", "webhook"
Config map[string]any `json:"config,omitempty" yaml:"config,omitempty"`
}
ChannelConfig holds configuration for a single channel adapter.
type HiAscend ¶
type HiAscend HistoryItems
HiAscend is history records sorted by time in ascending order, for sort.Interface
type HistoryChatItem ¶
HistoryChatItem is a single message in chat history
type HistoryItem ¶
type HistoryItem struct {
Time int64 `json:"ts"`
UID string `json:"uid,omitempty"`
// chat
ChatItem *HistoryChatItem `json:"ci"`
}
HistoryItem is a history record item with timestamp and chat content
func (*HistoryItem) MarshalBinary ¶
func (z *HistoryItem) MarshalBinary() (data []byte, err error)
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (*HistoryItem) UnmarshalBinary ¶
func (z *HistoryItem) UnmarshalBinary(data []byte) error
UnmarshalBinary unmarshal a binary representation of itself. for redis result.Scan
type HistoryItems ¶
type HistoryItems []HistoryItem
HistoryItems is a list of history records
func (HistoryItems) MarshalBinary ¶
func (z HistoryItems) MarshalBinary() (data []byte, err error)
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (HistoryItems) RecentlyWithTokens ¶
func (z HistoryItems) RecentlyWithTokens(size int) (ohi HistoryItems)
RecentlyWithTokens returns the most recent history records with total tokens not exceeding size
func (*HistoryItems) UnmarshalBinary ¶
func (z *HistoryItems) UnmarshalBinary(data []byte) error
UnmarshalBinary unmarshal a binary representation of itself. for redis result.Scan
type Preset ¶
type Preset struct {
Welcome string `json:"welcome,omitempty" yaml:"welcome,omitempty"`
SystemPrompt string `json:"systemPrompt,omitempty" yaml:"systemPrompt,omitempty"`
ToolsPrompt string `json:"toolsPrompt,omitempty" yaml:"toolsPrompt,omitempty"`
ChannelPrompt string `json:"channelPrompt,omitempty" yaml:"channelPrompt,omitempty"`
KeywordTpl string `json:"keywordTpl,omitempty" yaml:"keywordTpl,omitempty"`
TitleTpl string `json:"titleTpl,omitempty" yaml:"titleTpl,omitempty"`
// toolName -> description
Tools map[string]string `json:"tools,omitempty" yaml:"tools,omitempty"`
// Channels holds channel adapter configurations
Channels map[string]ChannelConfig `json:"channels,omitempty" yaml:"channels,omitempty"`
}
Preset is the preset configuration including welcome message, system prompt and tool descriptions