llama-stack/llama_stack/apis
Xi Yan a4bcfb8bba
[/scoring] add ability to define aggregation functions for scoring functions & refactors (#597)
# What does this PR do?

- Add ability to define aggregation functions for scoring functions via
`ScoringFnParams`
- Supported by `basic` / `regex_parser` / `llm_as_judge` scoring
functions


## Test Plan

```
pytest -v -s -m basic_scoring_together_inference scoring/test_scoring.py
```
<img width="855" alt="image"
src="https://github.com/user-attachments/assets/12db8e6e-2ad4-462e-b9b9-70ba6c050a6c">


```
pytest -v -s -m llm_as_judge_scoring_together_inference scoring/test_scoring.py
```
<img width="858" alt="image"
src="https://github.com/user-attachments/assets/bf806676-6f5e-456d-be9f-f81a26d1df19">



**Example Response** (`basic`)
<img width="863" alt="image"
src="https://github.com/user-attachments/assets/0e57a49c-8386-45cc-8fa9-3e61aaa9a3be">

**Example Response** (`llm-as-judge`)
<img width="854" alt="image"
src="https://github.com/user-attachments/assets/38065bc2-b724-47ed-9535-79b6099c4362">


## Sources

Please link relevant resources if necessary.


## Before submitting

- [ ] This PR fixes a typo or improves the docs (you can dismiss the
other checks if that's the case).
- [ ] Ran pre-commit to handle lint / formatting issues.
- [ ] Read the [contributor
guideline](https://github.com/meta-llama/llama-stack/blob/main/CONTRIBUTING.md),
      Pull Request section?
- [ ] Updated relevant documentation.
- [ ] Wrote necessary unit or integration tests.
2024-12-11 10:03:42 -08:00
..
agents memory retrival to print only the bytes injected 2024-12-10 09:32:18 -08:00
batch_inference Add version to REST API url (#478) 2024-11-18 22:44:14 -08:00
common [Evals API][4/n] evals with generation meta-reference impl (#303) 2024-10-25 13:12:39 -07:00
datasetio Telemetry API redesign (#525) 2024-12-04 11:22:45 -08:00
datasets unregister API for dataset (#507) 2024-12-03 21:18:30 -08:00
eval Add version to REST API url (#478) 2024-11-18 22:44:14 -08:00
eval_tasks Add version to REST API url (#478) 2024-11-18 22:44:14 -08:00
inference Console span processor improvements (#577) 2024-12-06 11:46:16 -08:00
inspect Remove "routing_table" and "routing_key" concepts for the user (#201) 2024-10-10 10:24:13 -07:00
memory Console span processor improvements (#577) 2024-12-06 11:46:16 -08:00
memory_banks Console span processor improvements (#577) 2024-12-06 11:46:16 -08:00
models Console span processor improvements (#577) 2024-12-06 11:46:16 -08:00
post_training Add version to REST API url (#478) 2024-11-18 22:44:14 -08:00
safety Console span processor improvements (#577) 2024-12-06 11:46:16 -08:00
scoring Add version to REST API url (#478) 2024-11-18 22:44:14 -08:00
scoring_functions [/scoring] add ability to define aggregation functions for scoring functions & refactors (#597) 2024-12-11 10:03:42 -08:00
shields Console span processor improvements (#577) 2024-12-06 11:46:16 -08:00
synthetic_data_generation Add version to REST API url (#478) 2024-11-18 22:44:14 -08:00
telemetry Regenerate openapi 2024-12-08 20:46:22 -08:00
__init__.py API Updates (#73) 2024-09-17 19:51:35 -07:00
resource.py Enable sane naming of registered objects with defaults (#429) 2024-11-12 11:18:05 -08:00
version.py Fix the pyopenapi generator avoid potential circular imports 2024-11-18 23:37:52 -08:00