models

package
v0.0.0-...-a72ae95 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioData

type AudioData struct {
	EventType AudioDataEvent
	ByteData  []byte
	Format    string
	Length    time.Duration
	Text      string // text representation
	Trace     Trace
}

AudioData TODO: This should grow up into a more realistic Event like Twilio or Vocode has i.e. distinguish inbound/outbound pipelines; hierarchy of Conversation -> Message -> Event and more event types like Silence / Interrupt / Stop / Finished.

func NewAudioDataSubmit

func NewAudioDataSubmit(creator string) AudioData

type AudioDataEvent

type AudioDataEvent int
const (
	AudioInput AudioDataEvent = iota
	AudioOutput
	SubmitPrompt
)

Declare constants with the custom type. These are your enum values.

type Conversation

type Conversation struct {
	StartedAt time.Time
	Messages  []Message
}

Conversation for the Chat API TODO: We can stop using it once the Assistant API supports streaming

func NewConversationSimple

func NewConversationSimple(text string) Conversation

func (*Conversation) Add

func (c *Conversation) Add(role string, content string)

func (*Conversation) DebugLog

func (c *Conversation) DebugLog()

func (*Conversation) GetLastPrompt

func (c *Conversation) GetLastPrompt() string

type Message

type Message struct {
	Role       string
	Content    string
	FinishedAt time.Time
}

type Trace

type Trace struct {
	CreatedAt time.Time
	Creator   string

	ReceivedAt time.Time

	ProcessedAt time.Time
	Processor   string
}

func NewTrace

func NewTrace(creator string) Trace

func (Trace) Log

func (t Trace) Log()

Jump to

Keyboard shortcuts

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