WeKnora deployment source with the reviewed wiki identity, summary and recovery fixes
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-weknora) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (latest, advisory) (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Build & Publish (dsh-weknora) / Publish to npm (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-weknora) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (latest, advisory) (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Build & Publish (dsh-weknora) / Publish to npm (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
package types
|
||||
|
||||
// RetrieverEngineType represents the type of retriever engine
|
||||
type RetrieverEngineType string
|
||||
|
||||
// RetrieverEngineType constants
|
||||
const (
|
||||
PostgresRetrieverEngineType RetrieverEngineType = "postgres"
|
||||
ElasticsearchRetrieverEngineType RetrieverEngineType = "elasticsearch"
|
||||
InfinityRetrieverEngineType RetrieverEngineType = "infinity"
|
||||
ElasticFaissRetrieverEngineType RetrieverEngineType = "elasticfaiss"
|
||||
QdrantRetrieverEngineType RetrieverEngineType = "qdrant"
|
||||
MilvusRetrieverEngineType RetrieverEngineType = "milvus"
|
||||
WeaviateRetrieverEngineType RetrieverEngineType = "weaviate"
|
||||
DorisRetrieverEngineType RetrieverEngineType = "doris"
|
||||
SQLiteRetrieverEngineType RetrieverEngineType = "sqlite"
|
||||
TencentVectorDBRetrieverEngineType RetrieverEngineType = "tencent_vectordb"
|
||||
// OpenSearchRetrieverEngineType identifies the OpenSearch k-NN driver
|
||||
// introduced in Phase 3 (see issue tracker). The driver itself ships
|
||||
// in a subsequent PR; this constant exists so that
|
||||
// EngineAwareNormalizer can register the OpenSearch case ahead of the
|
||||
// driver landing and the AuditAction constants can reference it
|
||||
// without forward dependencies. Wire value "opensearch" mirrors the
|
||||
// official product name and matches the value used in
|
||||
// retrieverEngineMapping / GetVectorStoreTypes once activation lands.
|
||||
OpenSearchRetrieverEngineType RetrieverEngineType = "opensearch"
|
||||
)
|
||||
|
||||
// RetrieverType represents the type of retriever
|
||||
type RetrieverType string
|
||||
|
||||
// RetrieverType constants
|
||||
const (
|
||||
KeywordsRetrieverType RetrieverType = "keywords" // Keywords retriever
|
||||
VectorRetrieverType RetrieverType = "vector" // Vector retriever
|
||||
WebSearchRetrieverType RetrieverType = "websearch" // Web search retriever
|
||||
)
|
||||
|
||||
// RetrieveParams represents the parameters for retrieval
|
||||
type RetrieveParams struct {
|
||||
// Query text
|
||||
Query string
|
||||
// Query embedding (used for vector retrieval)
|
||||
Embedding []float32
|
||||
// Knowledge base IDs
|
||||
KnowledgeBaseIDs []string
|
||||
// Knowledge IDs
|
||||
KnowledgeIDs []string
|
||||
// Tag IDs for filtering (used for FAQ priority filtering)
|
||||
TagIDs []string
|
||||
// Excluded knowledge IDs
|
||||
ExcludeKnowledgeIDs []string
|
||||
// Excluded chunk IDs
|
||||
ExcludeChunkIDs []string
|
||||
// Number of results to return
|
||||
TopK int
|
||||
// Similarity threshold
|
||||
Threshold float64
|
||||
// Knowledge type (e.g., "faq", "manual") - determines which index to use
|
||||
KnowledgeType string
|
||||
// Additional parameters, different retrievers may require different parameters
|
||||
AdditionalParams map[string]interface{}
|
||||
// Retriever type
|
||||
RetrieverType RetrieverType // Retriever type
|
||||
}
|
||||
|
||||
// RetrieverEngineParams represents the parameters for retriever engine
|
||||
type RetrieverEngineParams struct {
|
||||
// Retriever engine type
|
||||
RetrieverEngineType RetrieverEngineType `yaml:"retriever_engine_type" json:"retriever_engine_type"`
|
||||
// Retriever type
|
||||
RetrieverType RetrieverType `yaml:"retriever_type" json:"retriever_type"`
|
||||
}
|
||||
|
||||
// IndexWithScore represents the index with score
|
||||
type IndexWithScore struct {
|
||||
// ID
|
||||
ID string
|
||||
// Content
|
||||
Content string
|
||||
// Source ID
|
||||
SourceID string
|
||||
// Source type
|
||||
SourceType SourceType
|
||||
// Chunk ID
|
||||
ChunkID string
|
||||
// Knowledge ID
|
||||
KnowledgeID string
|
||||
// Knowledge base ID
|
||||
KnowledgeBaseID string
|
||||
// Tag ID
|
||||
TagID string
|
||||
// Score
|
||||
Score float64
|
||||
// Match type
|
||||
MatchType MatchType
|
||||
// IsEnabled
|
||||
IsEnabled bool
|
||||
}
|
||||
|
||||
// GetScore returns the score for ScoreComparable interface
|
||||
func (i *IndexWithScore) GetScore() float64 {
|
||||
return i.Score
|
||||
}
|
||||
|
||||
// RetrieveResult represents the result of retrieval
|
||||
type RetrieveResult struct {
|
||||
Results []*IndexWithScore // Retrieval results
|
||||
RetrieverEngineType RetrieverEngineType // Retrieval source type
|
||||
RetrieverType RetrieverType // Retrieval type
|
||||
Error error // Retrieval error
|
||||
}
|
||||
Reference in New Issue
Block a user