package
0.0.0-20250219065129-52aed497bc00
Repository: https://github.com/infinilabs/coco-server.git
Documentation: pkg.go.dev

# Functions

CheckValidTemplate checks if the template is valid through checking whether the given TemplateFormat is available and whether the template can be rendered.
NewAIMessagePromptTemplate creates a new AI message prompt template.
NewChatPromptTemplate creates a new chat prompt template from a list of message formatters.
NewFewShotPrompt creates a new few-shot prompt with the given input.
NewGenericMessagePromptTemplate creates a new generic message prompt template.
NewHumanMessagePromptTemplate creates a new human message prompt template.
NewPromptTemplate returns a new prompt template.
NewSystemMessagePromptTemplate creates a new system message prompt template.
RenderTemplate renders the template with the given values.

# Constants

TemplateFormatFString is the format for f-string.
TemplateFormatGoTemplate is the format for go-template.
TemplateFormatJinja2 is the format for jinja2.

# Variables

ErrExamplesAndExampleSelectorProvided is returned when there are no Examples and ExampleSelector.
ErrInputVariableReserved is returned when there is a conflict with a reserved variable name.
ErrInvalidPartialVariableType is returned when the partial variable is not a string or a function.
ErrInvalidTemplateFormat is the error when the template format is invalid and not supported.
ErrNeedChatMessageList is returned when the variable is not a list of chat messages.
ErrNoExample is returned when none of the Examples and ExampleSelector are provided.

# Structs

AIMessagePromptTemplate is a message formatter that returns an AI message.
ChatPromptTemplate is a prompt template for chat messages.
FewShotPrompt contains fields for a few-shot prompt.
GenericMessagePromptTemplate is a message formatter that returns message with the specified speaker.
HumanMessagePromptTemplate is a message formatter that returns a human message.
No description provided by the author
PromptTemplate contains common fields for all prompt templates.
SystemMessagePromptTemplate is a message formatter that returns a system message.

# Interfaces

ExampleSelector is an interface for example selectors.
FormatPrompter is an interface for formatting a map of values into a prompt.
Formatter is an interface for formatting a map of values into a string.
MessageFormatter is an interface for formatting a map of values into a list of messages.

# Type aliases

ChatPromptValue is a prompt value that is a list of chat messages.
StringPromptValue is a prompt value that is a string.
TemplateFormat is the format of the template.