Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultRAGPrompt = NewPromptTemplate(
`Use the following context to answer the question at the end.
If you don't know the answer, just say that you don't know, don't try to make up an answer.
Context:
{{.context}}
Question: {{.query}}
Helpful Answer:`)
DefaultRAGPrompt is a default prompt for Retrieval-Augmented Generation.
View Source
var DefaultValidationPrompt = NewPromptTemplate(
`You are an expert at evaluating whether a given context can help answer a user's question.
Context:
---
{{.context}}
---
Question: {{.query}}
Does the context contain information that is likely to be helpful in answering the question?
Answer only with "yes" or "no".
Answer:`)
Functions ¶
This section is empty.
Types ¶
type PromptTemplate ¶
type PromptTemplate struct {
Template string
}
PromptTemplate represents a string template that can be formatted.
func NewPromptTemplate ¶
func NewPromptTemplate(template string) PromptTemplate
NewPromptTemplate creates a new prompt template.
Click to show internal directories.
Click to hide internal directories.