Documentation
¶
Index ¶
- Variables
- func ListTemplateFields(t *template.Template) []string
- type AIMessageTemplate
- type ChatPromptValue
- type ChatTemplate
- type Formatter
- type HumanMessageTemplate
- type PartialValues
- type StringPromptValue
- type SystemMessageTemplate
- type Template
- func (p *Template) Format(values map[string]any) (string, error)
- func (p *Template) FormatPrompt(values map[string]any) (schema.PromptValue, error)
- func (p *Template) InputVariables() []string
- func (p *Template) OutputParser() (schema.OutputParser[any], bool)
- func (p *Template) Partial(values PartialValues) *Template
- type TemplateOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidPartialVariableType = errors.New("invalid partial variable type")
)
Functions ¶
func ListTemplateFields ¶
Types ¶
type AIMessageTemplate ¶ added in v0.0.26
type AIMessageTemplate struct {
// contains filtered or unexported fields
}
func NewAIMessageTemplate ¶ added in v0.0.26
func NewAIMessageTemplate(template string) *AIMessageTemplate
func (*AIMessageTemplate) Format ¶ added in v0.0.26
func (pt *AIMessageTemplate) Format(values map[string]any) (*schema.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 NewHumanMessageTemplate ¶ added in v0.0.26
func NewHumanMessageTemplate(template string) *HumanMessageTemplate
func (*HumanMessageTemplate) Format ¶
func (pt *HumanMessageTemplate) Format(values map[string]any) (*schema.HumanChatMessage, error)
type PartialValues ¶
type StringPromptValue ¶
type StringPromptValue string
func (StringPromptValue) Messages ¶
func (v StringPromptValue) Messages() schema.ChatMessages
func (StringPromptValue) String ¶
func (v StringPromptValue) String() string
type SystemMessageTemplate ¶
type SystemMessageTemplate struct {
// contains filtered or unexported fields
}
func NewSystemMessageTemplate ¶
func NewSystemMessageTemplate(template string) *SystemMessageTemplate
func (*SystemMessageTemplate) Format ¶
func (pt *SystemMessageTemplate) Format(values map[string]any) (*schema.SystemChatMessage, error)
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
func NewTemplate ¶
func NewTemplate(template string, optFns ...func(o *TemplateOptions)) *Template
func (*Template) FormatPrompt ¶
func (*Template) InputVariables ¶ added in v0.0.2
func (*Template) OutputParser ¶ added in v0.0.3
func (p *Template) OutputParser() (schema.OutputParser[any], bool)
func (*Template) Partial ¶
func (p *Template) Partial(values PartialValues) *Template
type TemplateOptions ¶
type TemplateOptions struct { PartialValues PartialValues Language string OutputParser schema.OutputParser[any] TransformPythonTemplate bool }
Click to show internal directories.
Click to hide internal directories.