Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPromptFromTemplate ¶
func BuildPromptFromTemplate(input InputPrompt, pt *template.Template) (string, error)
BuildPromptFromTemplate builds a prompt applying the given input to the template.
func BuildPromptFromTemplateFile ¶
func BuildPromptFromTemplateFile(input InputPrompt, filename string) (string, error)
BuildPromptFromTemplateFile builds a prompt applying the given input to the template file.
Types ¶
type InputPrompt ¶
type InputPrompt struct { Text string `json:"text"` Question string `json:"question,omitempty"` TargetLanguage string `json:"target_language,omitempty"` }
InputPrompt is the input for the prompt generation.
type VerbaFlow ¶
type VerbaFlow struct { Model *rwkvlm.Model Tokenizer tokenizer.Tokenizer // contains filtered or unexported fields }
VerbaFlow is the core struct of the library.
func (*VerbaFlow) Generate ¶
func (vf *VerbaFlow) Generate(ctx context.Context, nt *ag.NodesTracker, prompt string, chGen chan decoder.GeneratedToken, opts decoder.DecodingOptions) error
Generate generates a text from the given prompt. The "out" channel is used to stream the generated text. The generated text will be at most `maxTokens` long (in addition to the prompt).
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
examples
|
|
prompttester
Module
|
|
Package sliceutils provides types and functions for various operations over sliceutils of different types.
|
Package sliceutils provides types and functions for various operations over sliceutils of different types. |
Click to show internal directories.
Click to hide internal directories.