schema

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChatMessageToString

func ChatMessageToString(msg ChatMessage) string

Types

type AIChatMessage

type AIChatMessage struct {
	Content string
}

func NewAIChatMessage

func NewAIChatMessage(content string) AIChatMessage

func (AIChatMessage) GetContent

func (m AIChatMessage) GetContent() string

func (AIChatMessage) GetType

func (m AIChatMessage) GetType() ChatMessageType

type ChatMessage

type ChatMessage interface {
	GetType() ChatMessageType
	GetContent() string
}

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
	LineStart       int
	LineEnd         int
	Type            string
	Identifier      string
	Annotations     map[string]string
	TokenCount      int
	EnrichedContent string
	ParentContext   string
	ContextLevel    int
}

type CodeChunkingOptions

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

type CodeEntityDefinition

type CodeEntityDefinition struct {
	Type          string
	Name          string
	LineStart     int
	LineEnd       int
	Visibility    string
	Signature     string
	Documentation string
}

type CodeSymbol

type CodeSymbol struct {
	Name      string
	Type      string
	LineStart int
	LineEnd   int
	IsExport  bool
}

type CollectionInfo

type CollectionInfo struct {
	Name           string `json:"name"`            // Name of the collection.
	PointsCount    uint64 `json:"points_count"`    // Number of points (vectors) in the collection.
	VectorSize     uint64 `json:"vector_size"`     // Dimensionality of the vectors in this collection.
	VectorDistance string `json:"vector_distance"` // Distance metric used by the collection (e.g., "Cosine").
}

type ContentPart

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

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
	Language    string
	Imports     []string
	Definitions []CodeEntityDefinition
	Symbols     []CodeSymbol
	Properties  map[string]string
}

type HumanChatMessage

type HumanChatMessage struct {
	Content string
}

func NewHumanChatMessage

func NewHumanChatMessage(content string) HumanChatMessage

func (HumanChatMessage) GetContent

func (m HumanChatMessage) GetContent() string

func (HumanChatMessage) GetType

func (m HumanChatMessage) GetType() ChatMessageType

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 SystemChatMessage

type SystemChatMessage struct {
	Content string
}

func NewSystemChatMessage

func NewSystemChatMessage(content string) SystemChatMessage

Convenience constructors

func (SystemChatMessage) GetContent

func (m SystemChatMessage) GetContent() string

func (SystemChatMessage) GetType

func (m SystemChatMessage) GetType() ChatMessageType

type TextContent

type TextContent struct {
	Text string
}

func (TextContent) String

func (tc TextContent) String() string

Jump to

Keyboard shortcuts

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