- Python: Requires
langsmith>=0.2.0 - TypeScript: Support for multiple scores is available in
langsmith@0.1.32and higher
How to return multiple scores in one evaluator
Sometimes it is useful for a custom evaluator or summary evaluator to return multiple metrics. For example, if you have multiple metrics being generated by an LLM judge, you can save time and money by making a single LLM call that generates multiple metrics instead of making multiple LLM calls.
To return multiple scores using the Python SDK, simply return a list of dictionaries/objects of the following form:
To do so with the JS/TS SDK, return an object with a βresultsβ key and then a list of the above form
Each of these dictionaries can contain any or all of the feedback fields; check out the linked document for more information.
Example:
Rows from the resulting experiment will display each of the scores.