Closed alkshmir closed 6 months ago
To test the behavior of the chat bot, we may have to apply a mock of openai.Client. I have no idea how sashabaranov/go-openai provide mocking features. Without mocking, the chatbot is completely untestable.
https://github.com/sashabaranov/go-openai/blob/c6a63ed19aeb0e91facc5409c5a08612db550fb2/client.go#L16-L21
Client is struct but ClientConfig, utils.RequestBuilder is interfaces and createFormBuilder is a function type, thus it can be probably mocked.
ClientConfig
utils.RequestBuilder
createFormBuilder
To test the behavior of the chat bot, we may have to apply a mock of openai.Client. I have no idea how sashabaranov/go-openai provide mocking features. Without mocking, the chatbot is completely untestable.