summary

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package summary is designed to provide a comprehensive set of tools for automated text summarization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cohere

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

Cohere represents a text summarization algorithm powered by Cohere's AI models.

func NewCohere

func NewCohere(c *http.Client, opts *config.Options) *Cohere

NewCohere creates a `Cohere` instance with the specified `http.Client` instance and API key. If the `http.Client` instance is `nil`, the default client is used. This function returns a pointer to the newly created `Cohere` instance and an error, if any.

func (*Cohere) Summarize

func (coh *Cohere) Summarize(s string) (string, error)

Summarize generates a summary of the input text using Cohere's AI models. Returns the generated summary as a string and an error, if any.

type Legacy

type Legacy struct {
	*tldr.Bag
}

Legacy implements the Summarizer interface using the tldr.Bag package to perform local summarization.

func NewLegacy

func NewLegacy() *Legacy

NewLegacy creates a new instance of the Legacy struct with a new tldr.Bag instance.

func (*Legacy) Summarize

func (l *Legacy) Summarize(s string) (string, error)

Summarize generates a summary of the input text using legacy summarization. It returns the summary as a string and any error that occurred during summarization.

type Ollama

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

Ollama represents a text summarization client for Ollama LLM service.

func NewOllama

func NewOllama(c *http.Client, opts *config.Options) *Ollama

NewOllama creates a `Ollama` instance with the specified `http.Client` and options. If the `http.Client` instance is `nil`, the default client is used. This function returns a pointer to the newly created `Ollama` instance and an error, if any.

func (*Ollama) Summarize

func (o *Ollama) Summarize(s string) (string, error)

Summarize generates a summary of the input text using Ollama's AI models. Returns the generated summary as a string and an error, if any.

type OpenRouter

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

OpenRouter represents a text summarization client for OpenRouter LLM service.

func NewOpenRouter

func NewOpenRouter(c *http.Client, opts *config.Options) *OpenRouter

NewOpenRouter creates a `OpenRouter` instance with the specified `http.Client` and options. If the `http.Client` instance is `nil`, the default client is used. This function returns a pointer to the newly created `OpenRouter` instance and an error, if any.

func (*OpenRouter) Summarize

func (or *OpenRouter) Summarize(s string) (string, error)

Summarize generates a summary of the input text using OpenRouter's AI models. Returns the generated summary as a string and an error, if any.

type Requesty

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

Requesty represents a text summarization client for Requesty LLM service.

func NewRequesty

func NewRequesty(c *http.Client, opts *config.Options) *Requesty

NewRequesty creates a `Requesty` instance with the specified `http.Client` and options. If the `http.Client` instance is `nil`, the default client is used. This function returns a pointer to the newly created `Requesty` instance and an error, if any.

func (*Requesty) Summarize

func (rq *Requesty) Summarize(s string) (string, error)

Summarize generates a summary of the input text using Requesty's AI models. Returns the generated summary as a string and an error, if any.

type Summarizer

type Summarizer interface {
	Summarize(s string) (string, error)
}

Summarizer is the interface that wraps the basic Summarize method.

Summarize takes in a string of text and returns a summary.

func NewSummary

func NewSummary(opts *config.Options) Summarizer

NewSummary creates and returns a Summarizer based on the configured LLM provider. It inspects opts.LLMProvider() (case-insensitive) and constructs a provider-specific handler. It falls back to the legacy summarizer implementation. The returned Summarizer wraps the chosen handler.

Jump to

Keyboard shortcuts

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