workflow

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatAnalysis

func FormatAnalysis(result *lookup.Result) string

Types

type Counter

type Counter interface {
	CountBibliographyEntries(*documents.Bibliography) (int, error)
}

type EntryState

type EntryState struct {
	ID             string
	TextStatus     string
	Text           string
	AnalysisStatus string
	LookupCards    []LookupCard
	Summary        SummaryView
	Error          string
}

type Keys

type Keys struct {
	ShirtyAPIKey     string
	ShirtyBaseURL    string
	OpenRouterAPIKey string
}

type LookupCard added in v0.3.2

type LookupCard struct {
	Name   string
	Status string
	Detail string
}

func BuildLookupCards added in v0.3.2

func BuildLookupCards(result *lookup.Result) []LookupCard

type Options

type Options struct {
	Entry   int
	Workers int
}

type Progress

type Progress func(State)

type Provider

type Provider interface {
	PrepareBibliographyContent([]byte) (*documents.Bibliography, error)
	EntryFromBibliography(*documents.Bibliography, int) (string, error)
	entries.Classifier
	entries.Parser
	documents.MetaExtractor
	Summarize(*lookup.Result) (bool, string, error)
}

type ProviderKind

type ProviderKind string
const (
	ProviderNone       ProviderKind = ""
	ProviderShirty     ProviderKind = "Shirty"
	ProviderOpenRouter ProviderKind = "OpenRouter"
)

type Runtime

type Runtime struct {
	Kind           ProviderKind
	Provider       Provider
	Counter        Counter
	CrossrefClient *crossref.Client
}

func NewRuntime

func NewRuntime(keys Keys) (*Runtime, error)

type State

type State struct {
	Provider  ProviderKind
	Phase     string
	Total     int
	Completed int
	Entries   []EntryState
	Error     string
}

func AnalyzePDF

func AnalyzePDF(ctx context.Context, rt *Runtime, pdf []byte, progress Progress) State

func AnalyzePDFWithOptions

func AnalyzePDFWithOptions(ctx context.Context, rt *Runtime, pdf []byte, options Options, progress Progress) State

type SummaryView added in v0.3.2

type SummaryView struct {
	Status  string
	Comment string
}

func BuildSummaryView added in v0.3.2

func BuildSummaryView(result *lookup.Result) SummaryView

Jump to

Keyboard shortcuts

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