model

package
v0.2.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeChunk

type CodeChunk struct {
	Content      string // 代码内容
	RelativePath string // 相对文件路径
	StartLine    int    // 起始行号(从 1 开始)
	EndLine      int    // 结束行号
	Language     string // 编程语言标识
}

CodeChunk 代码分块

type IndexInfo

type IndexInfo struct {
	CodebaseID string           `json:"codebase_id"`
	Collection string           `json:"collection"`
	NumChunks  int64            `json:"num_chunks"`
	Languages  map[string]int64 `json:"languages,omitempty"` // 语言 → chunk 数(搜过一次后才有)
}

IndexInfo 已索引项目摘要(list 用)

type PushFile

type PushFile struct {
	RelativePath string `json:"relative_path"`
	Content      string `json:"content"`
}

PushFile 客户端推送的单个文件

type SearchResult

type SearchResult struct {
	Content      string  `json:"content"`
	RelativePath string  `json:"relative_path"`
	StartLine    int     `json:"start_line"`
	EndLine      int     `json:"end_line"`
	Language     string  `json:"language"`
	Score        float64 `json:"score"`
}

SearchResult 语义搜索结果

type UpsertResult

type UpsertResult struct {
	FilesProcessed    int `json:"files_processed"`
	ChunksProcessed   int `json:"chunks_processed"`    // 这次推送切出的 chunk 总数
	ChunksNewEmbedded int `json:"chunks_new_embedded"` // 触发 EMB 的新 chunk 数
	ChunksReused      int `json:"chunks_reused"`       // 命中既有 hash 跳过 EMB 的 chunk 数
	ChunksDeleted     int `json:"chunks_deleted"`      // 文件级清理 / 替换时删除的旧 chunk 数
}

UpsertResult upsert 操作的统计结果

type VectorDocument

type VectorDocument struct {
	ID           string    `json:"id"`
	ChunkHash    string    `json:"chunk_hash"`
	Content      string    `json:"content"`
	RelativePath string    `json:"relative_path"`
	StartLine    int       `json:"start_line"`
	EndLine      int       `json:"end_line"`
	Language     string    `json:"language"`
	Vector       []float32 `json:"vector"`
}

VectorDocument 向量数据库文档

type VectorSearchResult

type VectorSearchResult struct {
	Document VectorDocument `json:"document"`
	Score    float64        `json:"score"`
}

VectorSearchResult 向量搜索结果

Jump to

Keyboard shortcuts

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