extractor

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ParamArtifact is the key for artifact to process (*storage.Artifact).
	ParamArtifact = "artifact"
)

Request parameters for Extractor agent.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtractionResult

type ExtractionResult struct {
	Summary  string   `json:"summary"`   // 2-4 sentence description for semantic search
	Keywords []string `json:"keywords"`  // 5-10 tags for discovery
	Entities []string `json:"entities"`  // Named entities (people, companies, code mentioned)
	RAGHints []string `json:"rag_hints"` // Questions this file might answer
}

ExtractionResult contains the structured output from Gemini Flash. This is metadata-only output (~500 tokens) - no full text extraction.

type Extractor

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

Extractor processes artifact files using multimodal LLM. Generates metadata-only output (summary, keywords, entities, rag_hints).

func New

func New(
	executor *agent.Executor,
	translator *i18n.Translator,
	cfg *config.Config,
	logger *slog.Logger,
	fileStorage *files.FileStorage,
	llmClient openrouter.Client,
	artifactRepo storage.ArtifactRepository,
) *Extractor

New creates a new Extractor agent.

func (*Extractor) Capabilities

func (ex *Extractor) Capabilities() agent.Capabilities

Capabilities returns the agent's capabilities.

func (*Extractor) Description

func (ex *Extractor) Description() string

Description returns a human-readable description.

func (*Extractor) Execute

func (ex *Extractor) Execute(ctx context.Context, req *agent.Request) (*agent.Response, error)

Execute runs the extractor with the given request.

func (*Extractor) Type

func (ex *Extractor) Type() agent.AgentType

Type returns the agent type.

type ProcessResult

type ProcessResult struct {
	ArtifactID int64
	Summary    string
	Keywords   []string
	Entities   []string
	RAGHints   []string
	Duration   time.Duration
	Tokens     agent.TokenUsage
}

ProcessResult contains the final output of extraction.

type ProcessResultBuilder added in v0.6.1

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

ProcessResultBuilder builds ProcessResult objects for testing.

func NewProcessResultBuilder added in v0.6.1

func NewProcessResultBuilder() *ProcessResultBuilder

NewProcessResultBuilder creates a new ProcessResultBuilder.

func (*ProcessResultBuilder) Build added in v0.6.1

func (b *ProcessResultBuilder) Build() *ProcessResult

Build returns the constructed ProcessResult.

func (*ProcessResultBuilder) WithArtifactID added in v0.6.1

func (b *ProcessResultBuilder) WithArtifactID(id int64) *ProcessResultBuilder

WithArtifactID sets the artifact ID.

func (*ProcessResultBuilder) WithDuration added in v0.6.1

WithDuration sets the duration.

func (*ProcessResultBuilder) WithEntities added in v0.6.1

func (b *ProcessResultBuilder) WithEntities(entities ...string) *ProcessResultBuilder

WithEntities sets the entities (variadic for convenience).

func (*ProcessResultBuilder) WithKeywords added in v0.6.1

func (b *ProcessResultBuilder) WithKeywords(keywords ...string) *ProcessResultBuilder

WithKeywords sets the keywords (variadic for convenience).

func (*ProcessResultBuilder) WithRAGHints added in v0.6.1

func (b *ProcessResultBuilder) WithRAGHints(hints ...string) *ProcessResultBuilder

WithRAGHints sets the RAG hints (variadic for convenience).

func (*ProcessResultBuilder) WithSummary added in v0.6.1

func (b *ProcessResultBuilder) WithSummary(summary string) *ProcessResultBuilder

WithSummary sets the summary.

func (*ProcessResultBuilder) WithTokens added in v0.6.1

func (b *ProcessResultBuilder) WithTokens(prompt, completion, total int) *ProcessResultBuilder

WithTokens sets token usage.

Jump to

Keyboard shortcuts

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