Package io.micronaut.langchain4j.test
@NullMarked
package io.micronaut.langchain4j.test
Test support for Micronaut LangChain4j: a scripted chat model and evaluations driven by sample files.
- Since:
- 2.4.0
-
ClassDescriptionAssertions of
evaluation results.A sample of an evaluation: the input sent to the AI service, with the optional context that the response must be grounded in and the optional expected response, loaded from a sample file byEvaluationSamples.Loadsevaluation samplesfrom a YAML (or JSON) file of the classpath: a list of samples, or a map with asampleslist.Provides theevaluation samplesof a classpath file to a JUnitParameterizedTest, one invocation per sample.A chat model for tests that answers each request with the first matching rule, and records the requests.The answer of a rule.Builds the rules of aScriptedChatModel, evaluated in order.