message

package
v0.0.0-...-243689a Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package message encapsulates message methods and data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(s string) string

Format attempts to word-wrap at 80 columns and render markdown

Types

type Message

type Message struct {
	gorm.Model
	Content   string
	Date      time.Time
	Name      string
	Role      string
	SessionID uint
}

Message encapsulates a chat message

func Unpack

func Unpack(m openai.ChatCompletionMessage, sessID uint) Message

Unpack openai.ChatCompletionMessage into a native Message object

func (*Message) Display

func (msg *Message) Display()

Display prints a message to stdout

func (*Message) Pack

func (m *Message) Pack() openai.ChatCompletionMessage

Pack packages a native Message object into an openai.ChatCompletionMessage

Jump to

Keyboard shortcuts

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