sync: migrate ai-operator to Gitea (2026-08-10)

This commit is contained in:
konturai-ops
2026-08-10 15:26:52 +00:00
commit 53652b95ad
173 changed files with 16676 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
package embedding
import (
"context"
"testing"
)
func TestFakeProviderDeterministic(t *testing.T) {
p := NewFakeProvider(1536, "fake")
a, err := p.Embed(context.Background(), []string{"hello", "world"})
if err != nil {
t.Fatal(err)
}
b, _ := p.Embed(context.Background(), []string{"hello"})
if len(a) != 2 || len(a[0]) != 1536 || len(b[0]) != 1536 {
t.Fatalf("bad dims")
}
if a[0][0] != b[0][0] {
t.Fatalf("not deterministic")
}
if a[0][0] == a[1][0] && a[0][1] == a[1][1] {
t.Fatalf("different inputs too similar")
}
}