-
Notifications
You must be signed in to change notification settings - Fork 430
Endpoint Properties in IOpenAIAPI interface #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
by usage of the interfaces of the endpoints
by the ChatEndpoint
fixed auth tests
Hmm personally i think we're trying to do way more in this single class than just one thing and therefore separation might be better. Even worse we're also replicating a lot of stuff amongst other endpoint classes. The things we're now trying to do per endpoint:
Then for the logic to call/stream a certain api the stuff is replicated. See: Embedding, Files, Images, Chat. How about the following:
With this approach every class is responsible for 1 task. This also makes the classes shorter and easier to comprehend and at last makes the testing way easier as you don't have to mock/stub as much since the logic is spread around more classes which have their own tests to back things up. |
These are good ideas that apply to the project in general. A separate ticket could certainly be created for this. My interest in this ticket is only to be able to test services with Moq that use this NuGet package. I am not the developer of the package. And otherwise, I'll build a wrapper around the NuGet package and retire here. |
Agreed to hit those refactors off in another ticket |
I have made an error in the IOpenAIAPI interface (and the OpenAIAPI class). The endpoint properties should be defined as interfaces instead of classes so that they are also suitable for Moq tests. Additionally, the IChatEndpoint interface should be added as a property.
Wrong:
Correct:
The text was updated successfully, but these errors were encountered: