completion

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTombStone

func IsTombStone(cmpl Completion) bool

Types

type Completion

type Completion interface {
	Content() string
	Timestamp() time.Time
}

Completion is a union type that can be either a CompletionData or a CompletionTombStone. This is used to represent completions in the completion history. A completion will always end up as a CompletionTomStone after it has been used.

type Data

type Data struct {
	// contains filtered or unexported fields
}

Data is a struct that represents the data of a completion.

func NewCompletionData

func NewCompletionData(content string) Data

func (Data) Content

func (c Data) Content() string

func (Data) Timestamp

func (c Data) Timestamp() time.Time

func (Data) WithContent

func (c Data) WithContent(content string) Data

func (Data) WithTimestamp

func (c Data) WithTimestamp(t time.Time) Data

type Tombstone

type Tombstone struct {
	// contains filtered or unexported fields
}

A completion tombstone is the final state of a completion.

func NewCompletionTombStone

func NewCompletionTombStone(
	content, model string,
	usage Usage,
) Tombstone

func (Tombstone) Content

func (c Tombstone) Content() string

func (Tombstone) Model

func (c Tombstone) Model() string

func (Tombstone) Timestamp

func (c Tombstone) Timestamp() time.Time

func (Tombstone) Usage

func (c Tombstone) Usage() Usage

func (Tombstone) WithContent

func (c Tombstone) WithContent(content string) Tombstone

func (Tombstone) WithModel

func (c Tombstone) WithModel(model string) Tombstone

func (Tombstone) WithTimestamp

func (c Tombstone) WithTimestamp(t time.Time) Tombstone

func (Tombstone) WithUsage

func (c Tombstone) WithUsage(usage Usage) Tombstone

type Usage

type Usage struct {
}

Usage is a struct that represents the usage of a completion.

Jump to

Keyboard shortcuts

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