Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidPartialVariableType = errors.New("invalid partial variable type")
)
Functions ¶
func ListTemplateFields ¶
Types ¶
type AIMessagetTemplate ¶
type AIMessagetTemplate struct {
// contains filtered or unexported fields
}
func (*AIMessagetTemplate) Format ¶
func (pt *AIMessagetTemplate) Format(values map[string]any) (*golc.AIChatMessage, error)
type ChatPromptValue ¶
type ChatPromptValue struct{}
type ChatTemplate ¶
type ChatTemplate struct{}
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
func NewFormatter ¶
type HumanMessageTemplate ¶
type HumanMessageTemplate struct {
// contains filtered or unexported fields
}
func (*HumanMessageTemplate) Format ¶
func (pt *HumanMessageTemplate) Format(values map[string]any) (*golc.HumanChatMessage, error)
type PartialValues ¶
type StringPromptValue ¶
type StringPromptValue string
func (StringPromptValue) Messages ¶
func (v StringPromptValue) Messages() []golc.ChatMessage
func (StringPromptValue) String ¶
func (v StringPromptValue) String() string
type SystemMessageTemplate ¶
type SystemMessageTemplate struct {
// contains filtered or unexported fields
}
func NewSystemMessageTemplate ¶
func NewSystemMessageTemplate(prompt *Template) *SystemMessageTemplate
func (*SystemMessageTemplate) Format ¶
func (pt *SystemMessageTemplate) Format(values map[string]any) (*golc.SystemChatMessage, error)
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
func NewTemplate ¶
func NewTemplate(template string, optFns ...func(o *TemplateOptions)) (*Template, error)
func (*Template) FormatPrompt ¶
type TemplateOptions ¶
type TemplateOptions struct { PartialValues PartialValues Language string }
Click to show internal directories.
Click to hide internal directories.