schema

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatMessageType

type ChatMessageType string
const (
	ChatMessageTypeSystem  ChatMessageType = "system"
	ChatMessageTypeHuman   ChatMessageType = "human"
	ChatMessageTypeAI      ChatMessageType = "ai"
	ChatMessageTypeGeneric ChatMessageType = "generic"
)

type CodeChunk

type CodeChunk struct {
	Content         string            `json:"content"`
	LineStart       int               `json:"lineStart"`
	LineEnd         int               `json:"lineEnd"`
	Type            string            `json:"type"`
	Identifier      string            `json:"identifier"`
	Annotations     map[string]string `json:"annotations"`
	TokenCount      int               `json:"tokenCount"`
	EnrichedContent string            `json:"enrichedContent"`
	ParentContext   string            `json:"parentContext"`
	ContextLevel    int               `json:"contextLevel"`
}

type CodeChunkingOptions

type CodeChunkingOptions struct {
	ChunkSize         int
	OverlapTokens     int
	PreserveStructure bool
	LanguageHints     []string
	MaxLinesPerChunk  int
	MinCharsPerChunk  int
}

type CodeEntityDefinition

type CodeEntityDefinition struct {
	Type          string `json:"type"`
	Name          string `json:"name"`
	LineStart     int    `json:"line_start"`
	LineEnd       int    `json:"line_end"`
	Visibility    string `json:"visibility"`
	Signature     string `json:"signature"`
	Documentation string `json:"documentation"`
}

type CodeSymbol

type CodeSymbol struct {
	Name      string `json:"name"`
	Type      string `json:"type"`
	LineStart int    `json:"line_start"`
	LineEnd   int    `json:"line_end"`
	IsExport  bool   `json:"is_export"`
}

type ContentChoice added in v0.2.0

type ContentChoice struct {
	Content          string
	StopReason       string
	GenerationInfo   map[string]any
	ReasoningContent string
}

type ContentPart

type ContentPart interface {
	String() string
	// contains filtered or unexported methods
}

type ContentResponse added in v0.2.0

type ContentResponse struct {
	Choices []*ContentChoice
}

type Document

type Document struct {
	PageContent string
	Metadata    map[string]any
}

func NewDocument

func NewDocument(content string, metadata map[string]any) Document

func (Document) String

func (d Document) String() string

type FileMetadata

type FileMetadata struct {
	FilePath    string                 `json:"file_path"`
	Language    string                 `json:"language"`
	Imports     []string               `json:"imports"`
	Definitions []CodeEntityDefinition `json:"definitions"`
	Symbols     []CodeSymbol           `json:"symbols"`
	Properties  map[string]string      `json:"properties"`
}

type MessageContent

type MessageContent struct {
	Role  ChatMessageType
	Parts []ContentPart
}

func NewAIMessage

func NewAIMessage(text string) MessageContent

func NewHumanMessage

func NewHumanMessage(text string) MessageContent

func NewSystemMessage

func NewSystemMessage(text string) MessageContent

func NewTextMessage

func NewTextMessage(role ChatMessageType, text string) MessageContent

func (MessageContent) GetTextContent

func (mc MessageContent) GetTextContent() string

func (MessageContent) String

func (mc MessageContent) String() string

type ModelDetails

type ModelDetails struct {
	Family        string
	ParameterSize string
	Quantization  string
	Dimension     int64
}

func (ModelDetails) String

func (md ModelDetails) String() string

type ParserPlugin

type ParserPlugin interface {
	Name() string
	Extensions() []string
	CanHandle(path string, info fs.FileInfo) bool
	Chunk(content string, path string, opts *CodeChunkingOptions) ([]CodeChunk, error)
	ExtractMetadata(content string, path string) (FileMetadata, error)
}

type Retriever

type Retriever interface {
	GetRelevantDocuments(ctx context.Context, query string) ([]Document, error)
}

type TextContent

type TextContent struct {
	Text string
}

func (TextContent) String

func (tc TextContent) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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