Documentation
¶
Index ¶
- Constants
- func FIMFingerprint(name string) (string, error)
- func FIMFormats() []string
- func NextEditFingerprint(format string) (string, error)
- func NextEditFormats() []string
- func TokenizeFIM(input AutocompleteInput, tokenize func(string, bool) ([]int, error)) ([]int, []int, error)
- func TokenizeParts(parts []TextPart, stops []string, tokenize func(string, bool) ([]int, error)) ([]int, []int, error)
- func TokenizerCompanionControls(operation, format string) (int, []string, error)
- func ValidateEdits(input NextEditInput, edits []TextEdit) error
- type AutocompleteInput
- type ContextFile
- type EditHistory
- type FIMFormat
- type NextEditInput
- type NextEditProfile
- type PreparedEdit
- type TextDecoder
- type TextEdit
- type TextPart
Constants ¶
View Source
const CompletionFormatSchemaFile = "completion_formats.json"
Variables ¶
This section is empty.
Functions ¶
func FIMFingerprint ¶
func FIMFormats ¶
func FIMFormats() []string
func NextEditFingerprint ¶
func NextEditFormats ¶
func NextEditFormats() []string
func TokenizeFIM ¶
func TokenizeParts ¶
func ValidateEdits ¶
func ValidateEdits(input NextEditInput, edits []TextEdit) error
Types ¶
type AutocompleteInput ¶
type ContextFile ¶
type EditHistory ¶
type FIMFormat ¶
type FIMFormat struct {
ID string
Version int
Kind string
Prefix string
Suffix string
Middle string
Stops []string
}
func ResolveFIM ¶
type NextEditInput ¶
type NextEditInput struct {
Path string `json:"path"`
Before string `json:"before"`
Current string `json:"current"`
Cursor int `json:"cursor"`
Start int `json:"start"`
End int `json:"end"`
History []EditHistory `json:"history"`
Context []ContextFile `json:"context"`
}
func (NextEditInput) Validate ¶
func (i NextEditInput) Validate() error
type NextEditProfile ¶
type NextEditProfile struct {
ID string
Version int
ContextTokens int
MaxTokens int
Stops []string
TextStops []string
}
func ResolveNextEdit ¶
func ResolveNextEdit(format string) (NextEditProfile, error)
type PreparedEdit ¶
type PreparedEdit struct {
Parts []TextPart
Prefill string
Stops []string
TextStops []string
// contains filtered or unexported fields
}
func PrepareNextEdit ¶
func PrepareNextEdit(format string, input NextEditInput) (PreparedEdit, error)
func (PreparedEdit) EndpointStops ¶
func (p PreparedEdit) EndpointStops() []string
func (PreparedEdit) Parse ¶
func (p PreparedEdit) Parse(output, finishReason string) ([]TextEdit, error)
func (PreparedEdit) Render ¶
func (p PreparedEdit) Render() string
type TextDecoder ¶
Click to show internal directories.
Click to hide internal directories.