Documentation ¶
Index ¶
- Variables
- func IsChatModel(model schema.Model) bool
- func IsLLM(model schema.Model) bool
- type Conditional
- type ConditionalFunc
- type ConditionalPromptSelector
- type Conversation
- func (c *Conversation) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (c *Conversation) Callbacks() []schema.Callback
- func (c *Conversation) InputKeys() []string
- func (c *Conversation) Memory() schema.Memory
- func (c *Conversation) OutputKeys() []string
- func (c *Conversation) Prompt() *prompt.Template
- func (c *Conversation) Type() string
- func (c *Conversation) Verbose() bool
- type ConversationOptions
- type LLMBash
- func (c *LLMBash) Call(ctx context.Context, values schema.ChainValues) (schema.ChainValues, error)
- func (c *LLMBash) Callbacks() []schema.Callback
- func (c *LLMBash) InputKeys() []string
- func (c *LLMBash) Memory() schema.Memory
- func (c *LLMBash) OutputKeys() []string
- func (c *LLMBash) Type() string
- func (c *LLMBash) Verbose() bool
- type LLMBashOptions
- type LLMChain
- func (c *LLMChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (c *LLMChain) Callbacks() []schema.Callback
- func (c *LLMChain) InputKeys() []string
- func (c *LLMChain) Memory() schema.Memory
- func (c *LLMChain) OutputKeys() []string
- func (c *LLMChain) Prompt() *prompt.Template
- func (c *LLMChain) Type() string
- func (c *LLMChain) Verbose() bool
- type LLMChainOptions
- type LLMMath
- func (c *LLMMath) Call(ctx context.Context, values schema.ChainValues) (schema.ChainValues, error)
- func (c *LLMMath) Callbacks() []schema.Callback
- func (c *LLMMath) InputKeys() []string
- func (c *LLMMath) Memory() schema.Memory
- func (c *LLMMath) OutputKeys() []string
- func (c *LLMMath) Type() string
- func (c *LLMMath) Verbose() bool
- type LLMMathOptions
- type PromptSelector
- type RefineDocuments
- func (c *RefineDocuments) Call(ctx context.Context, values schema.ChainValues) (schema.ChainValues, error)
- func (c *RefineDocuments) Callbacks() []schema.Callback
- func (c *RefineDocuments) InputKeys() []string
- func (c *RefineDocuments) Memory() schema.Memory
- func (c *RefineDocuments) OutputKeys() []string
- func (c *RefineDocuments) Type() string
- func (c *RefineDocuments) Verbose() bool
- type RefineDocumentsOptions
- type RefineSummarizationOptions
- type RetrievalQA
- func (c *RetrievalQA) Call(ctx context.Context, values schema.ChainValues) (schema.ChainValues, error)
- func (c *RetrievalQA) Callbacks() []schema.Callback
- func (c *RetrievalQA) InputKeys() []string
- func (c *RetrievalQA) Memory() schema.Memory
- func (c *RetrievalQA) OutputKeys() []string
- func (c *RetrievalQA) Type() string
- func (c *RetrievalQA) Verbose() bool
- type RetrievalQAOptions
- type StuffDocuments
- func (c *StuffDocuments) Call(ctx context.Context, values schema.ChainValues) (schema.ChainValues, error)
- func (c *StuffDocuments) Callbacks() []schema.Callback
- func (c *StuffDocuments) InputKeys() []string
- func (c *StuffDocuments) Memory() schema.Memory
- func (c *StuffDocuments) OutputKeys() []string
- func (c *StuffDocuments) Type() string
- func (c *StuffDocuments) Verbose() bool
- type StuffDocumentsOptions
- type StuffSummarizationOptions
- type TransformChain
- func (c *TransformChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (c *TransformChain) Callbacks() []schema.Callback
- func (c *TransformChain) InputKeys() []string
- func (c *TransformChain) Memory() schema.Memory
- func (c *TransformChain) OutputKeys() []string
- func (c *TransformChain) Type() string
- func (c *TransformChain) Verbose() bool
- type TransformChainOptions
- type TransformFunc
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func IsChatModel ¶ added in v0.0.14
IsChatModel checks if the given model is of type schema.ChatModel.
Types ¶
type Conditional ¶ added in v0.0.14
type Conditional struct { Condition ConditionalFunc Prompt *prompt.Template }
Conditional represents a conditional prompt configuration.
type ConditionalFunc ¶ added in v0.0.14
ConditionalFunc represents a function that evaluates a condition based on a model.
type ConditionalPromptSelector ¶ added in v0.0.14
type ConditionalPromptSelector struct { DefaultPrompt *prompt.Template Conditionals []Conditional }
ConditionalPromptSelector is a prompt selector that selects prompts based on conditions.
func (*ConditionalPromptSelector) GetPrompt ¶ added in v0.0.14
func (cps *ConditionalPromptSelector) GetPrompt(model schema.Model) *prompt.Template
GetPrompt selects a prompt template based on the provided model. It evaluates the conditions in order and returns the prompt associated with the first matching condition, or returns the default prompt if no condition is met.
type Conversation ¶ added in v0.0.10
type Conversation struct {
// contains filtered or unexported fields
}
func NewConversation ¶ added in v0.0.10
func NewConversation(llm schema.LLM, optFns ...func(o *ConversationOptions)) (*Conversation, error)
func (*Conversation) Call ¶ added in v0.0.10
func (c *Conversation) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (*Conversation) Callbacks ¶ added in v0.0.13
func (c *Conversation) Callbacks() []schema.Callback
func (*Conversation) InputKeys ¶ added in v0.0.10
func (c *Conversation) InputKeys() []string
InputKeys returns the expected input keys.
func (*Conversation) Memory ¶ added in v0.0.13
func (c *Conversation) Memory() schema.Memory
func (*Conversation) OutputKeys ¶ added in v0.0.10
func (c *Conversation) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
func (*Conversation) Prompt ¶ added in v0.0.10
func (c *Conversation) Prompt() *prompt.Template
func (*Conversation) Type ¶ added in v0.0.13
func (c *Conversation) Type() string
func (*Conversation) Verbose ¶ added in v0.0.13
func (c *Conversation) Verbose() bool
type ConversationOptions ¶ added in v0.0.10
type ConversationOptions struct { *schema.CallbackOptions Prompt *prompt.Template Memory schema.Memory OutputKey string OutputParser schema.OutputParser[any] }
type LLMBash ¶ added in v0.0.11
type LLMBash struct {
// contains filtered or unexported fields
}
func NewLLMBash ¶ added in v0.0.11
func NewLLMBash(llmChain *LLMChain, optFns ...func(o *LLMBashOptions)) (*LLMBash, error)
func (*LLMBash) Call ¶ added in v0.0.11
func (c *LLMBash) Call(ctx context.Context, values schema.ChainValues) (schema.ChainValues, error)
func (*LLMBash) OutputKeys ¶ added in v0.0.11
OutputKeys returns the output keys the chain will return.
type LLMBashOptions ¶ added in v0.0.11
type LLMBashOptions struct { *schema.CallbackOptions InputKey string OutputKey string }
type LLMChain ¶
type LLMChain struct {
// contains filtered or unexported fields
}
func NewLLMChain ¶
func (*LLMChain) Call ¶ added in v0.0.2
func (c *LLMChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (*LLMChain) OutputKeys ¶ added in v0.0.2
OutputKeys returns the output keys the chain will return.
type LLMChainOptions ¶
type LLMChainOptions struct { *schema.CallbackOptions Memory schema.Memory OutputKey string OutputParser schema.OutputParser[any] }
type LLMMath ¶ added in v0.0.11
type LLMMath struct {
// contains filtered or unexported fields
}
func NewLLMMath ¶ added in v0.0.11
func NewLLMMath(llmChain *LLMChain, optFns ...func(o *LLMMathOptions)) (*LLMMath, error)
func (*LLMMath) Call ¶ added in v0.0.11
func (c *LLMMath) Call(ctx context.Context, values schema.ChainValues) (schema.ChainValues, error)
func (*LLMMath) OutputKeys ¶ added in v0.0.11
OutputKeys returns the output keys the chain will return.
type LLMMathOptions ¶ added in v0.0.11
type LLMMathOptions struct { *schema.CallbackOptions InputKey string OutputKey string }
type PromptSelector ¶ added in v0.0.14
PromptSelector is an interface for selecting prompts based on a model.
type RefineDocuments ¶ added in v0.0.13
type RefineDocuments struct {
// contains filtered or unexported fields
}
func NewRefineDocuments ¶ added in v0.0.13
func NewRefineDocuments(llmChain *LLMChain, refineLLMChain *LLMChain, optFns ...func(o *RefineDocumentsOptions)) (*RefineDocuments, error)
func NewRefineSummarization ¶ added in v0.0.13
func NewRefineSummarization(llm schema.LLM, optFns ...func(o *RefineSummarizationOptions)) (*RefineDocuments, error)
func (*RefineDocuments) Call ¶ added in v0.0.13
func (c *RefineDocuments) Call(ctx context.Context, values schema.ChainValues) (schema.ChainValues, error)
func (*RefineDocuments) Callbacks ¶ added in v0.0.13
func (c *RefineDocuments) Callbacks() []schema.Callback
func (*RefineDocuments) InputKeys ¶ added in v0.0.13
func (c *RefineDocuments) InputKeys() []string
InputKeys returns the expected input keys.
func (*RefineDocuments) Memory ¶ added in v0.0.13
func (c *RefineDocuments) Memory() schema.Memory
func (*RefineDocuments) OutputKeys ¶ added in v0.0.13
func (c *RefineDocuments) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
func (*RefineDocuments) Type ¶ added in v0.0.13
func (c *RefineDocuments) Type() string
func (*RefineDocuments) Verbose ¶ added in v0.0.13
func (c *RefineDocuments) Verbose() bool
type RefineDocumentsOptions ¶
type RefineSummarizationOptions ¶ added in v0.0.13
type RefineSummarizationOptions struct {
*schema.CallbackOptions
}
type RetrievalQA ¶ added in v0.0.2
type RetrievalQA struct {
// contains filtered or unexported fields
}
func NewRetrievalQA ¶ added in v0.0.2
func NewRetrievalQA(stuffDocumentsChain *StuffDocuments, retriever schema.Retriever, optFns ...func(o *RetrievalQAOptions)) (*RetrievalQA, error)
func NewRetrievalQAFromLLM ¶ added in v0.0.2
func (*RetrievalQA) Call ¶ added in v0.0.2
func (c *RetrievalQA) Call(ctx context.Context, values schema.ChainValues) (schema.ChainValues, error)
func (*RetrievalQA) Callbacks ¶ added in v0.0.13
func (c *RetrievalQA) Callbacks() []schema.Callback
func (*RetrievalQA) InputKeys ¶ added in v0.0.2
func (c *RetrievalQA) InputKeys() []string
InputKeys returns the expected input keys.
func (*RetrievalQA) Memory ¶ added in v0.0.13
func (c *RetrievalQA) Memory() schema.Memory
func (*RetrievalQA) OutputKeys ¶ added in v0.0.2
func (c *RetrievalQA) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
func (*RetrievalQA) Type ¶ added in v0.0.13
func (c *RetrievalQA) Type() string
func (*RetrievalQA) Verbose ¶ added in v0.0.13
func (c *RetrievalQA) Verbose() bool
type RetrievalQAOptions ¶ added in v0.0.2
type RetrievalQAOptions struct { *schema.CallbackOptions InputKey string ReturnSourceDocuments bool }
type StuffDocuments ¶ added in v0.0.13
type StuffDocuments struct {
// contains filtered or unexported fields
}
func NewStuffDocuments ¶ added in v0.0.13
func NewStuffDocuments(llmChain *LLMChain, optFns ...func(o *StuffDocumentsOptions)) (*StuffDocuments, error)
func NewStuffSummarization ¶ added in v0.0.13
func NewStuffSummarization(llm schema.LLM, optFns ...func(o *StuffSummarizationOptions)) (*StuffDocuments, error)
func (*StuffDocuments) Call ¶ added in v0.0.13
func (c *StuffDocuments) Call(ctx context.Context, values schema.ChainValues) (schema.ChainValues, error)
func (*StuffDocuments) Callbacks ¶ added in v0.0.13
func (c *StuffDocuments) Callbacks() []schema.Callback
func (*StuffDocuments) InputKeys ¶ added in v0.0.13
func (c *StuffDocuments) InputKeys() []string
InputKeys returns the expected input keys.
func (*StuffDocuments) Memory ¶ added in v0.0.13
func (c *StuffDocuments) Memory() schema.Memory
func (*StuffDocuments) OutputKeys ¶ added in v0.0.13
func (c *StuffDocuments) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
func (*StuffDocuments) Type ¶ added in v0.0.13
func (c *StuffDocuments) Type() string
func (*StuffDocuments) Verbose ¶ added in v0.0.13
func (c *StuffDocuments) Verbose() bool
type StuffDocumentsOptions ¶
type StuffDocumentsOptions struct { *schema.CallbackOptions InputKey string DocumentVariableName string Separator string }
type StuffSummarizationOptions ¶ added in v0.0.13
type StuffSummarizationOptions struct {
*schema.CallbackOptions
}
type TransformChain ¶ added in v0.0.6
type TransformChain struct {
// contains filtered or unexported fields
}
func NewTransformChain ¶ added in v0.0.6
func NewTransformChain(inputKeys, outputKeys []string, transform TransformFunc, optFns ...func(o *TransformChainOptions)) (*TransformChain, error)
func (*TransformChain) Call ¶ added in v0.0.6
func (c *TransformChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (*TransformChain) Callbacks ¶ added in v0.0.13
func (c *TransformChain) Callbacks() []schema.Callback
func (*TransformChain) InputKeys ¶ added in v0.0.6
func (c *TransformChain) InputKeys() []string
InputKeys returns the expected input keys.
func (*TransformChain) Memory ¶ added in v0.0.13
func (c *TransformChain) Memory() schema.Memory
func (*TransformChain) OutputKeys ¶ added in v0.0.6
func (c *TransformChain) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
func (*TransformChain) Type ¶ added in v0.0.13
func (c *TransformChain) Type() string
func (*TransformChain) Verbose ¶ added in v0.0.13
func (c *TransformChain) Verbose() bool
type TransformChainOptions ¶ added in v0.0.9
type TransformChainOptions struct {
*schema.CallbackOptions
}
type TransformFunc ¶ added in v0.0.6
type TransformFunc func(inputs schema.ChainValues) (schema.ChainValues, error)