-
Notifications
You must be signed in to change notification settings - Fork 290
feat(langchaingo): add tests using testcontainers-go #97
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
Conversation
| ``` | ||
|
|
||
| or | ||
| or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this should be fixed if you update your branch, the linter doesn't return any errors on main for me ATM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed you had allowed edits, so I merged main on it.
What does this PR do?
This PR refactors the chat code to be more testable, using dependency injection of the OpenAI values (baseURL, key and model) in the form of function arguments. Therefore, it's possible to call the chat with differnt values (for production, or at test-time).
Once the code is more testable, this PR adds four different tests for the chat response:
With these four tests, users can understand the different approaches to testing when building GenAI apps.