[fix] tests
This commit is contained in:
parent
4e37119714
commit
4ee38de7e7
1 changed files with 3 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ package openai
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/yaoapp/yao/config"
|
"github.com/yaoapp/yao/config"
|
||||||
"github.com/yaoapp/yao/connector"
|
"github.com/yaoapp/yao/connector"
|
||||||
|
|
@ -94,13 +95,13 @@ func TestEdits(t *testing.T) {
|
||||||
defer test.Clean()
|
defer test.Clean()
|
||||||
|
|
||||||
openai := prepare(t, "text-davinci-edit-001")
|
openai := prepare(t, "text-davinci-edit-001")
|
||||||
data, err := openai.Edits("Fix the spelling mistakes", nil)
|
data, err := openai.Edits("Hello world"+uuid.NewString(), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err.Message)
|
t.Fatal(err.Message)
|
||||||
}
|
}
|
||||||
assert.NotNil(t, data.(map[string]interface{})["created"])
|
assert.NotNil(t, data.(map[string]interface{})["created"])
|
||||||
|
|
||||||
data, err = openai.Edits("Fix the spelling mistakes 2nd", map[string]interface{}{"input": "What day of the wek is it?"})
|
data, err = openai.Edits("Fix the spelling mistakes 2nd"+uuid.NewString(), map[string]interface{}{"input": "What day of the wek is it?"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err.Message)
|
t.Fatal(err.Message)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue