Documentation
¶
Overview ¶
Package rank contains a prompt command to rank arbitrary large lists through iteration. It is based on the raink algorithm described and implemented here: https://bishopfox.com/blog/raink-llms-document-ranking https://github.com/noperator/raink
Index ¶
Constants ¶
View Source
const ( Name = "rank" MultilineSeparator = "\n----\n" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Item ¶
type Item struct {
ID string `json:"id"`
Contents string `json:"contents"`
RankHistory []int `json:"-"`
}
func (*Item) RankingScore ¶
type Items ¶
type Items []*Item
func MergeBatches ¶
func (Items) AddRankings ¶
func (Items) RankSorted ¶
type Rank ¶
type Rank struct {
// contains filtered or unexported fields
}
func (*Rank) SetTeaEmitter ¶
func (r *Rank) SetTeaEmitter(emitter uimsg.TeaEmitter)
type RequestMessage ¶
type RequestMessage struct {
commands.MessageType
PromptMessage commands.PromptMessage
Iteration int
BatchIdx int
Batch Items
Description string
ResponseChan chan<- ResponseMessage `json:"-"`
Retries int
}
type ResponseMessage ¶
type ResponseMessage struct {
RequestMessage
Message string
Err error
}
Click to show internal directories.
Click to hide internal directories.