Documentation
¶
Overview ¶
Start of Selection
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssistantMessage ¶
func AssistantMessage(content string) openai.ChatCompletionMessageParamUnion
func DeveloperMessage ¶
func DeveloperMessage(content string) openai.ChatCompletionMessageParamUnion
func UserMessage ¶
func UserMessage(content string) openai.ChatCompletionMessageParamUnion
We have custom UserMessage/AssistantMessage/DeveloperMessage because openai go sdk currently have openai.DeveloperMessage()
Types ¶
type MessageList ¶
type MessageList struct {
Messages []openai.ChatCompletionMessageParamUnion
}
MessageList holds an ordered collection of LLMMessage to preserve the history.
func NewMessageList ¶
func NewMessageList() *MessageList
func (*MessageList) Add ¶
func (ml *MessageList) Add(msg openai.ChatCompletionMessageParamUnion)
Add appends a new message to the MessageList in a FIFO order.
func (*MessageList) All ¶
func (ml *MessageList) All() []openai.ChatCompletionMessageParamUnion
func (*MessageList) Clone ¶
func (ml *MessageList) Clone() *MessageList
func (*MessageList) LastUserMessageString ¶
func (ml *MessageList) LastUserMessageString() string
Click to show internal directories.
Click to hide internal directories.