summarization

package
v0.0.0-...-1ea5cf0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapReduceSummarizationChain

type MapReduceSummarizationChain struct {
	// contains filtered or unexported fields
}

func NewMapReduceSummarizationChain

func NewMapReduceSummarizationChain(llmChain *llm_chain.LLMChain, callbackManager *callback.Manager, mapPromptString string, reducePromptString string,
	promptTemplateKey string,
	splitter textsplitter.TextSplitter, maxToken int, verbose bool) (m *MapReduceSummarizationChain, err error)

NewMapReduceSummarizationChain create new map reduce summarization chain instance put empty "" string to use default prompt put 0 to use default maxToken

func (*MapReduceSummarizationChain) Run

func (M *MapReduceSummarizationChain) Run(ctx context.Context, input map[string]string, options ...func(*model.Option)) (output map[string]string, err error)

Run expect input["input"] as input, and put the result to output["output"]

func (*MapReduceSummarizationChain) SimpleRun

func (M *MapReduceSummarizationChain) SimpleRun(ctx context.Context, input string, options ...func(*model.Option)) (output string, err error)

SimpleRun will run the input prompt string againts llmchain

type StuffSummarizationChain

type StuffSummarizationChain struct {
	// contains filtered or unexported fields
}

func NewStuffSummarizationChain

func NewStuffSummarizationChain(llm_chain *llm_chain.LLMChain, callbackManager *callback.Manager,
	promptTemplateString string, promptTemplateKey string, verbose bool) (s *StuffSummarizationChain, err error)

func (*StuffSummarizationChain) Run

func (S *StuffSummarizationChain) Run(ctx context.Context, input map[string]string, options ...func(*model.Option)) (output map[string]string, err error)

Run all entries in input map will be treated as document to be combined output will be output["output"]

func (*StuffSummarizationChain) SimpleRun

func (S *StuffSummarizationChain) SimpleRun(ctx context.Context, input string, options ...func(*model.Option)) (output string, err error)

SimpleRun will run the input prompt string againts llmchain

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL