Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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"`
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"`
}
Preset is the preset configuration including welcome message, system prompt and tool descriptions