Skip to content

Add llm4s-testing module to template#3

Open
krrish175-byte wants to merge 1 commit intollm4s:mainfrom
krrish175-byte:feature/issue-2-testing-module
Open

Add llm4s-testing module to template#3
krrish175-byte wants to merge 1 commit intollm4s:mainfrom
krrish175-byte:feature/issue-2-testing-module

Conversation

@krrish175-byte
Copy link

Description:

This PR introduces a new llm4s-testing module to the llm4s.g8 template, providing a suite of utilities for robust and deterministic testing of LLM-based applications.

Key Features:

MockLLMClient: Allows developers to programmatically define expected inputs and mock responses for unit testing.
RecordingLLMClient: Wraps an existing client to record real LLM interactions to a file, enabling the creation of realistic test data.
PlaybackLLMClient: Replays recorded interactions to ensure tests are deterministic, fast, and cost-free (no API calls).
Scrubber: Automatically sanitizes sensitive information (such as API keys) from recordings before saving them.

Technical Changes:

Added llm4s-testing source and test directories to the template.
Updated build.sbt to configure a multi-module build, correctly separating munit (root) and scalatest (testing) dependencies.
Implemented custom upickle serializers in Interaction.scala to handle llm4s models.
Verified compatibility with llm4s version 0.1.9.

@krrish175-byte
Copy link
Author

@vim89 @rorygraves

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

Comments