Documentation ¶
Index ¶
- func ClosestVector(a []float64, bs [][]float64) (max float64, pos int, err error)
- func CosineSimilarity(a []float64, b []float64) (cosine float64, err error)
- func GoogleChat(model string, messages []Message, examples []Example, params map[string]any) (string, error)
- func GoogleExtractContent(body string) (string, error)
- func OpenaiChat(model string, messages []Message, params map[string]any) (string, error)
- func OpenaiEmbedding(inputs []string) (string, error)
- func OpenaiExtractContent(body string) (string, error)
- type Chat
- type Example
- type Message
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClosestVector ¶
finds the clostes in bs to a, returning the max similarity and position
func CosineSimilarity ¶
https://en.wikipedia.org/wiki/Cosine_similarity 1 is similare 0 is orthogonal -1 is opposite
func GoogleChat ¶
func GoogleExtractContent ¶
func OpenaiChat ¶
func OpenaiEmbedding ¶
func OpenaiExtractContent ¶
Types ¶
type Chat ¶
type Chat struct { *hof.Node[any] Name string HumanName string MachineName string Description string HumanDescription string MachineDescription string // user inputs Args []string Files map[string]string Question string Model string System string Examples []Example Messages []Message Parameters map[string]any }
Click to show internal directories.
Click to hide internal directories.