Skip to content
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

Convert to use mimic for mocking calls #155

Merged
merged 2 commits into from
Jul 17, 2024
Merged

Convert to use mimic for mocking calls #155

merged 2 commits into from
Jul 17, 2024

Conversation

brainlid
Copy link
Owner

This change includes the Mimic testing library for mocking out live calls and forcing a specific return value.

Originally, was using LangChain.Utils.ApiOverride which provided process-level result overrides. However, it had the negative requirement of requiring testing-aware to be in the production code, specifically in the ChatXYZ.call functions.

Using Mimic removes that requirement, keeping the production level code cleaner.

The selection of Mimic started in PR #154. I tried out Mimic and liked it well enough.

brainlid added 2 commits July 16, 2024 21:52
- updated LLMChain tests
- removed special test handling code from ChatOpenAI
- setup test helper
- removed production test code from ChatBumblebee
- removed from ChatMistral
- removed from ChatAnthropic
- removed from OpenAIImage
- removed LangChain.Utils.ApiOverride
- migrated more tests to use mimic
  - TextToTitleChain tests
  - RoutingChain tests
  - ChatBumblebee tests
@brainlid brainlid merged commit 0d2dc6a into main Jul 17, 2024
1 check passed
@brainlid brainlid deleted the me-convert-to-mimic branch July 17, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant