(rasa_app: SanicASGITestClient, stories_path: Text)
| 623 | |
| 624 | |
| 625 | async def test_evaluate_stories(rasa_app: SanicASGITestClient, stories_path: Text): |
| 626 | stories = rasa.shared.utils.io.read_file(stories_path) |
| 627 | |
| 628 | _, response = await rasa_app.post( |
| 629 | "/model/test/stories", |
| 630 | data=stories, |
| 631 | headers={"Content-type": rasa.server.YAML_CONTENT_TYPE}, |
| 632 | ) |
| 633 | |
| 634 | assert response.status == HTTPStatus.OK |
| 635 | |
| 636 | js = response.json |
| 637 | assert set(js.keys()) == { |
| 638 | "report", |
| 639 | "precision", |
| 640 | "f1", |
| 641 | "accuracy", |
| 642 | "actions", |
| 643 | "in_training_data_fraction", |
| 644 | "is_end_to_end_evaluation", |
| 645 | } |
| 646 | assert not js["is_end_to_end_evaluation"] |
| 647 | assert set(js["actions"][0].keys()) == { |
| 648 | "action", |
| 649 | "predicted", |
| 650 | "confidence", |
| 651 | "policy", |
| 652 | } |
| 653 | |
| 654 | |
| 655 | async def test_evaluate_stories_not_ready_agent( |
nothing calls this directly
no test coverage detected
searching dependent graphs…