textactions

package
v0.35.22 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSummarizerNotConfigured   = &summaryError{message: "summarizer not configured"}
	ErrSummarizeInputUnavailable = &summaryError{message: "summarize input unavailable"}
)

Functions

This section is empty.

Types

type FlowSummarizer

type FlowSummarizer struct {
	Flow *core.Flow[flows.SummarizeInput, string, struct{}]
}

FlowSummarizer implements Summarizer using a Genkit summarize flow.

func (*FlowSummarizer) Summarize

func (s *FlowSummarizer) Summarize(ctx context.Context, input Input) (string, error)

type Input

type Input struct {
	Text        string
	Instruction string
	Locale      string
	Source      Source
}

func ResolveSummarizeContext

func ResolveSummarizeContext(ctx SummarizeContext) Input

type Source

type Source string
const (
	SourceSelection         Source = "selection"
	SourceLastTranscription Source = "last_transcription"
	SourceUtterance         Source = "utterance"
)

type SummarizeContext

type SummarizeContext struct {
	Selection         string
	LastTranscription string
	Utterance         string
	Locale            string
}

type Summarizer

type Summarizer interface {
	Summarize(ctx context.Context, input Input) (string, error)
}

type SummarizerFunc

type SummarizerFunc func(context.Context, Input) (string, error)

func (SummarizerFunc) Summarize

func (f SummarizerFunc) Summarize(ctx context.Context, input Input) (string, error)

type SummaryTool

type SummaryTool struct {
	Summarizer Summarizer
}

func (SummaryTool) Run

func (t SummaryTool) Run(ctx context.Context, input Input) (string, error)

Jump to

Keyboard shortcuts

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