llm

package
v0.0.0-...-40becd4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 1 Imported by: 0

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 LLMConfig

type LLMConfig struct {
	APIKey  string
	BaseURL string
	Model   string
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL