yay ai test fails

main
bel 2024-04-12 16:31:23 -06:00
parent 046dc0e1ba
commit 5f31a2c572
2 changed files with 40 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/slack-bot-vr /slack-bot-vr
**/*.sw*
/spoc-bot-vr /spoc-bot-vr

View File

@ -4,6 +4,7 @@ package main
import ( import (
"context" "context"
"fmt"
"io" "io"
"net/http" "net/http"
"os" "os"
@ -54,9 +55,42 @@ func TestAILocal(t *testing.T) {
0.9, 0.9,
) )
t.Run("mvp", func(t *testing.T) {
if result, err := ai.Do(ctx, "hello world"); err != nil { if result, err := ai.Do(ctx, "hello world"); err != nil {
t.Fatal(err) t.Fatal(err)
} else if len(result) < 250 {
t.Error(result)
} else { } else {
t.Logf("%s", result) t.Logf("%s", result)
} }
})
t.Run("simulation", func(t *testing.T) {
d := NewRAM()
FillWithTestdata(ctx, d)
s := NewStorage(d)
threads, err := s.Threads(ctx)
if err != nil || len(threads) < 1 {
t.Fatal(err)
}
thread, err := s.Thread(ctx, threads[0])
if err != nil || len(thread) < 1 {
t.Fatal(err)
}
input := fmt.Sprintf(`
Summarize the following forum converstion.
---
%s
`, thread[0].Plaintext)
t.Logf("\n\t%s", input)
result, err := ai.Do(ctx, input)
if err != nil {
t.Fatal(err)
}
t.Logf("\n\t%s\n->\n\t%s", input, result)
})
} }