yay ai test fails
parent
046dc0e1ba
commit
5f31a2c572
|
|
@ -1,2 +1,3 @@
|
||||||
/slack-bot-vr
|
/slack-bot-vr
|
||||||
|
**/*.sw*
|
||||||
/spoc-bot-vr
|
/spoc-bot-vr
|
||||||
|
|
|
||||||
44
ai_test.go
44
ai_test.go
|
|
@ -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,
|
||||||
)
|
)
|
||||||
|
|
||||||
if result, err := ai.Do(ctx, "hello world"); err != nil {
|
t.Run("mvp", func(t *testing.T) {
|
||||||
t.Fatal(err)
|
if result, err := ai.Do(ctx, "hello world"); err != nil {
|
||||||
} else {
|
t.Fatal(err)
|
||||||
t.Logf("%s", result)
|
} else if len(result) < 250 {
|
||||||
}
|
t.Error(result)
|
||||||
|
} else {
|
||||||
|
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)
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue