common

package
v1.4.66 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const ChatMessageRoleMeta = "meta"

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatOptions

type ChatOptions struct {
	Model            string
	Temperature      float64
	TopP             float64
	PresencePenalty  float64
	FrequencyPenalty float64
	Raw              bool
	Seed             int
}

type ChatRequest

type ChatRequest struct {
	ContextName      string
	SessionName      string
	PatternName      string
	PatternVariables map[string]string
	Message          string
	Language         string
	Meta             string
}

type Message

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

func NormalizeMessages

func NormalizeMessages(msgs []*Message, defaultUserMessage string) (ret []*Message)

NormalizeMessages remove empty messages and ensure messages order user-assist-user

Jump to

Keyboard shortcuts

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