types

package
v0.0.0-...-063ee89 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package types defines shared data structures for the gfy pipeline.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Confidence

type Confidence string

Confidence indicates how a relationship was determined.

const (
	Extracted Confidence = "EXTRACTED"
	Inferred  Confidence = "INFERRED"
	Ambiguous Confidence = "AMBIGUOUS"
)

type DetectionResult

type DetectionResult struct {
	Files            map[FileType][]string `json:"files"`
	TotalFiles       int                   `json:"total_files"`
	TotalWords       int                   `json:"total_words"`
	NeedsGraph       bool                  `json:"needs_graph"`
	Warning          string                `json:"warning,omitempty"`
	SkippedSensitive []string              `json:"skipped_sensitive"`
	GfyIgnoreCount   int                   `json:"gfyignore_patterns"`
}

DetectionResult holds the output of file discovery and classification.

type Edge

type Edge struct {
	Source          string     `json:"source"`
	Target          string     `json:"target"`
	Relation        string     `json:"relation"`
	Confidence      Confidence `json:"confidence"`
	ConfidenceScore float64    `json:"confidence_score,omitempty"`
	SourceFile      string     `json:"source_file"`
	SourceLocation  string     `json:"source_location,omitempty"`
	Weight          float64    `json:"weight"`
}

Edge represents a relationship between two nodes.

type ExtractionResult

type ExtractionResult struct {
	Nodes        []Node    `json:"nodes"`
	Edges        []Edge    `json:"edges"`
	RawCalls     []RawCall `json:"raw_calls,omitempty"`
	InputTokens  int       `json:"input_tokens"`
	OutputTokens int       `json:"output_tokens"`
	Error        string    `json:"error,omitempty"`
}

ExtractionResult holds the output of extracting one or more files.

type FileType

type FileType string

FileType classifies detected files.

const (
	Code     FileType = "code"
	Document FileType = "document"
	Paper    FileType = "paper"
	Image    FileType = "image"
	Video    FileType = "video"
	// Used in extraction output for special node types.
	Rationale FileType = "rationale"
	Concept   FileType = "concept"
)

type Node

type Node struct {
	ID             string   `json:"id"`
	Label          string   `json:"label"`
	FileType       string   `json:"file_type"`
	SourceFile     string   `json:"source_file"`
	SourceLocation string   `json:"source_location,omitempty"`
	Tags           []string `json:"tags,omitempty"`
	Comment        string   `json:"comment,omitempty"`
	// Content holds the full or truncated text body of a document-type node
	// (e.g., markdown/PDF/DOCX/XLSX). It is used as input to embedding and
	// semantic search but is generally not part of the AST extraction path.
	Content       string   `json:"content,omitempty"`
	LogMessages   []string `json:"log_messages,omitempty"`
	ThrowMessages []string `json:"throw_messages,omitempty"`
}

Node represents a single entity in the knowledge graph.

type RawCall

type RawCall struct {
	CallerNID    string `json:"caller_nid"`
	Callee       string `json:"callee"`
	IsMemberCall bool   `json:"is_member_call"`
	SourceFile   string `json:"source_file"`
	SourceLoc    string `json:"source_location"`
}

RawCall records an unresolved function call for cross-file resolution.

Jump to

Keyboard shortcuts

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