MCPcopy
hub / github.com/RasaHQ/rasa / test_evaluate_stories

Function test_evaluate_stories

tests/test_server.py:625–652  ·  view source on GitHub ↗
(rasa_app: SanicASGITestClient, stories_path: Text)

Source from the content-addressed store, hash-verified

623
624
625async 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
655async def test_evaluate_stories_not_ready_agent(

Callers

nothing calls this directly

Calls 1

keysMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…