MCPcopy Create free account
hub / github.com/astercloud/aster / NewMockEmbedder

Function NewMockEmbedder

pkg/vector/mock_embedder.go:15–20  ·  view source on GitHub ↗

NewMockEmbedder 创建一个 MockEmbedder。 Dim 指定向量维度, 默认为 16。

(dim int)

Source from the content-addressed store, hash-verified

13// NewMockEmbedder 创建一个 MockEmbedder。
14// Dim 指定向量维度, 默认为 16。
15func NewMockEmbedder(dim int) *MockEmbedder {
16 if dim <= 0 {
17 dim = 16
18 }
19 return &MockEmbedder{Dim: dim}
20}
21
22// EmbedText 将文本映射为简单的伪随机向量(基于字节值),
23// 只保证同一文本得到相同向量, 不保证语义质量。

Callers 10

TestFactory_AddAndSearchFunction · 0.92
TestPipeline_IngestEmptyFunction · 0.92
TestPipeline_EmptyTextFunction · 0.92
DefaultInMemoryPipelineFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92

Calls

no outgoing calls

Tested by 5

TestFactory_AddAndSearchFunction · 0.74
TestPipeline_IngestEmptyFunction · 0.74
TestPipeline_EmptyTextFunction · 0.74