> ## Documentation Index
> Fetch the complete documentation index at: https://rasa.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Evaluate stories

> Evaluates one or multiple stories against the currently loaded Rasa model.



## OpenAPI

````yaml /openapi/pro.yaml post /model/test/stories
openapi: 3.0.1
info:
  title: Rasa - Server Endpoints
  version: 1.0.0
  description: >-
    The Rasa server provides endpoints to retrieve trackers of conversations as
    well as endpoints to modify them. Additionally, endpoints for training and
    testing models are provided.
servers:
  - url: http://localhost:5005
    description: Local development server
security: []
paths:
  /model/test/stories:
    post:
      tags:
        - Model
      summary: Evaluate stories
      description: >-
        Evaluates one or multiple stories against the currently loaded Rasa
        model.
      operationId: testModelStories
      parameters:
        - $ref: '#/components/parameters/e2e'
      requestBody:
        required: true
        content:
          text/yml:
            schema:
              $ref: '#/components/schemas/StoriesTrainingData'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvaluationStoriesResult'
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          $ref: '#/components/responses/401NotAuthenticated'
        '403':
          $ref: '#/components/responses/403NotAuthorized'
        '409':
          $ref: '#/components/responses/409Conflict'
        '500':
          $ref: '#/components/responses/500ServerError'
      security:
        - TokenAuth: []
        - JWT: []
components:
  parameters:
    e2e:
      in: query
      name: e2e
      description: Perform an end-to-end evaluation on the posted stories.
      example: false
      schema:
        type: boolean
        default: false
      required: false
  schemas:
    StoriesTrainingData:
      type: string
      description: Rasa Core stories in YAML format
      example: |-
        - story: happy path
          steps:
          - intent: greet
          - action: utter_greet
          - intent: mood_great
          - action: utter_happy

        - story: sad path 1
          steps:
          - intent: greet
          - action: utter_greet
          - intent: mood_unhappy
          - action: utter_cheer_up
          - action: utter_did_that_help
          - intent: affirm
          - action: utter_happy

        - story: sad path 2
          steps:
          - intent: greet
          - action: utter_greet
          - intent: mood_unhappy
          - action: utter_cheer_up
          - action: utter_did_that_help
          - intent: deny
          - action: utter_goodbye

        - story: say goodbye
          steps:
          - intent: goodbye
          - action: utter_goodbye
    EvaluationStoriesResult:
      type: object
      properties:
        actions:
          type: array
          items:
            type: object
            properties:
              action:
                type: string
                description: Name of the actual action
                example: utter_ask_howcanhelp
              predicted:
                type: string
                description: Name of the predicted action
                example: utter_ask_howcanhelp
              policy:
                type: string
                description: Machine-learning policy used in the prediction
                example: policy_0_MemoizationPolicy
              confidence:
                type: string
                description: Confidence score of the prediction
                example: 1
          description: >-
            Accuracy of the classification,
            http://scikit-learn.org/stable/modules/generated/sklearn.metrics.accuracy_score.html
        is_end_to_end_evaluation:
          type: boolean
          description: True if evaluation is end-to-end, false otherwise
          example: true
        precision:
          type: number
          description: >-
            Precision of the classification, see
            http://scikit-learn.org/stable/modules/generated/sklearn.metrics.precision_score.html
          example: 1
        f1:
          type: number
          description: >-
            F1 score of the classification,
            http://scikit-learn.org/stable/modules/generated/sklearn.metrics.precision_score.html
          example: 0.9333333333333333
        accuracy:
          type: number
          description: >-
            Accuracy of the classification,
            http://scikit-learn.org/stable/modules/generated/sklearn.metrics.accuracy_score.html
          example: 0.9
        in_training_data_fraction:
          type: number
          description: >-
            Fraction of stories that are present in the training data of the
            model loaded at evaluation time.
          example: 0.8571428571428571
        report:
          type: object
          description: >-
            Sklearn classification reported extended with information about
            conversation accuracy.
          additionalProperties:
            type: object
            properties:
              intent_name:
                type: string
              classification_report:
                $ref: '#/components/schemas/EvaluationReport'
          properties:
            conversation_accuracy:
              $ref: '#/components/schemas/ConversationAccuracyReport'
    EvaluationReport:
      type: object
      description: >-
        Sklearn classification report, see
        http://scikit-learn.org/stable/modules/generated/sklearn.metrics.classification_report.html
      example:
        greet:
          precision: 0.123
          recall: 0.456
          f1-score: 0.12
          support: 100
          confused_with:
            chitchat: 3
            nlu_fallback: 5
        micro avg:
          precision: 0.123
          recall: 0.456
          f1-score: 0.12
          support: 100
        macro avg:
          precision: 0.123
          recall: 0.456
          f1-score: 0.12
          support: 100
        weightedq avg:
          precision: 0.123
          recall: 0.456
          f1-score: 0.12
          support: 100
    ConversationAccuracyReport:
      type: object
      properties:
        accuracy:
          type: number
          example: 0.19047619047619047
        correct:
          type: number
          example: 18
        with_warnings:
          type: number
          example: 1
        total:
          type: number
          example: 20
    Error:
      type: object
      properties:
        version:
          type: string
          description: Rasa version
        status:
          type: string
          enum:
            - failure
          description: Status of the requested action
        message:
          type: string
          description: Error message
        reason:
          type: string
          description: Error category
        details:
          type: object
          description: Additional error information
        help:
          type: string
          description: Optional URL to additonal material
        code:
          type: number
          description: HTTP status code
  responses:
    400BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            version: 1.0.0
            status: failure
            reason: BadRequest
            code: 400
    401NotAuthenticated:
      description: User is not authenticated.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            version: 1.0.0
            status: failure
            reason: NotAuthenticated
            message: User is not authenticated to access resource.
            code: 401
    403NotAuthorized:
      description: User has insufficient permission.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            version: 1.0.0
            status: failure
            reason: NotAuthorized
            message: User has insufficient permission to access resource.
            code: 403
    409Conflict:
      description: The request conflicts with the currently loaded model.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            version: 1.0.0
            status: failure
            reason: Conflict
            message: The request conflicts with the currently loaded model.
            code: 409
    500ServerError:
      description: An unexpected error occurred.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            version: 1.0.0
            status: ServerError
            message: An unexpected error occurred.
            code: 500
  securitySchemes:
    TokenAuth:
      type: apiKey
      in: query
      name: token
      description: >
        A plaintext token to secure your server, specified at startup in the
        argument `--auth-token thisismysecret`
    JWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        A JWT token that is signed using the JWT secret specified at startup in
        the argument `--jwt-secret thisismysecret`,

        using the `HS256` algorithm.


        The token's payload must contain an object under the `user` key,

        which in turn must contain the `username` and `role` attributes.

        The following is an example payload for a JWT token:


        ```json

        {
            "user": {
                "username": "<sender_id>",
                "role": "user"
            }
        }

        ```


        If the `role` is `admin`, all endpoints are accessible.

        If the `role` is `user`, endpoints with a `sender_id` parameter are only
        accessible

        if the `sender_id` matches the payload's `username` property.


        For the user trackers endpoint (`GET /users/{user_id}/trackers`), you
        should use `user_id` instead of `username` in the payload.

        In this case, the path `user_id` parameter is matched against the
        payload's `username` property. For example:


        ```json

        {
            "user": {
                "username": "<user_id>",
                "role": "user"
            }
        }

        ```

````