You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, in many test cases, we return empty structs from the test server. For example:
server.RegisterHandler("/v1/engines/text-davinci-003", func(w http.ResponseWriter, r*http.Request) {
resBytes, _:=json.Marshal(Engine{}) // <------------- Here we return empty Engine structfmt.Fprintln(w, string(resBytes))
})
It is possible for such tests not to cover a case where client does not return a proper response, see for example this discussion: #485 (comment)
It would be good to make these structs non-empty, and the best solution would probably be to randomize them (keeping randomization logic in the internal/test directory). So in the end we'll get something like:
- Avoid big package
- Use strings.Builder for efficient string concatenation
- Set default string length to 10
- Handle errors from rand.Read()
Resolves: sashabaranov#487
ealvar3z
added a commit
to ealvar3z/go-openai
that referenced
this issue
Sep 14, 2023
- Memory efficient solution for RandomInt func
- Improve error handling by logging them vice returning the type
- Use RandomInt() instead
Resolves: sashabaranov#487
Currently, in many test cases, we return empty structs from the test server. For example:
It is possible for such tests not to cover a case where client does not return a proper response, see for example this discussion: #485 (comment)
It would be good to make these structs non-empty, and the best solution would probably be to randomize them (keeping randomization logic in the
internal/test
directory). So in the end we'll get something like:The text was updated successfully, but these errors were encountered: