Rasa - Server Endpoints

本文详细介绍了Rasa服务器提供的各种API端点,包括获取会话跟踪、修改追踪状态、模型训练和评估,以及健康检查和版本信息。这些端点对于管理和维护Rasa对话系统至关重要。
openapi: 3.0.1
info:
  title: "Rasa - Server Endpoints"
  version: "1.0.0"
  description: >-
    Rasa服务器提供用于检索会话跟踪程序的端点(endpoints)以及用于修改会话跟踪程序的端点。
    此外,还提供了用于训练和测试模型的端点。
    
servers:
  - url: "http://localhost:5005"
    description: "Local development server"

paths:
  /:
    get:
      tags:
      - Server Information
      summary: Health endpoint of Rasa Server
      operationId: getHealth
      description: >-
        This URL can be used as an endpoint to run
        health checks against. When the server is running
        this will return 200.
      responses:
        200:
          description: Up and running
          content:
            text/plain:
              schema:
                type: string
                description: Welcome text of Rasa Server
              example: >-
                Hello from Rasa: 1.0.0

  /version:
    get:
      tags:
      - Server Information
      operationId: getVersion
      summary: Version of Rasa
      description: >-
        Returns the version of Rasa.
      responses:
        200:
          description: Version of Rasa
          content:
            application/json:
              schema:
                type: object
                properties:
                  version:
                    type: string
                    description: >-
                      Rasa version number
                  minimum_compatible_version:
                    type: string
                    description: >-
                      Minimum version this Rasa version is
                      able to load models from
              example:
                version: 1.0.0
                minimum_compatible_version: 1.0.0

  /status:
    get:
      security:
      - TokenAuth: []
      - JWT: []
      operationId: getStatus
      tags:
      - Server Information
      summary: Status of the Rasa server
      description: >-
        Information about the server and the currently loaded Rasa model.
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  fingerprint:
                    type: object
                    description: Fingerprint of the loaded model
                    example:
                      config:
                        - 7625d69d93053ac8520a544d0852c626
                      domain:
                        - 229b51e41876bbcbbbfbeddf79548d5a
                      messages:
                        - cf7eda7edcae128a75ee8c95d3bbd680
                      stories:
                        - b5facea681fd00bc7ecc6818c70d9639
                      trained_at: 1556527123.42784
                      version: 1.0.0
                  model_file:
                    type: string
                    description: Path of the loaded model
                    example: 20190429-103105.tar.gz
                  num_active_training_jobs:
                    type: integer
                    description: Number of running training processes
                    example: 2
        401:
          $ref: '#/components/responses/401NotAuthenticated'
        403:
          $ref: '#/components/responses/403NotAuthorized'
        409:
          $ref: '#/components/responses/409Conflict'


  /conversations/{
   
   conversation_id}/tracker:
    get:
      security:
      - TokenAuth: []
      - JWT: []
      operationId: getConversationTracker
      tags:
      - Tracker
      summary: Retrieve a conversations tracker
      description: >-
        The tracker represents the state of the conversation.
        The state of the tracker is created by applying a
        sequence of events, which modify the state. These
        events can optionally be included in the response.
      parameters:
      - $ref: '#/components/parameters/conversation_id'
      - $ref: '#/components/parameters/include_events'
      - $ref: '#/components/parameters/until'
      responses:
        200:
          $ref: '#/components/responses/200Tracker'
        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'

  /conversations/{
   
   conversation_id}/tracker/events:
    post:
      security:
      - TokenAuth: []
      - JWT: []
      operationId: addConversationTrackerEvents
      tags:
      - Tracker
      summary: Append events to a tracker
      description: >-
        Appends one or multiple new events to the tracker state of the conversation.
        Any existing events will be kept and the new events will be appended,
        updating the existing state.
        If events are appended to a new conversation ID, the tracker will be
        initialised with a new session.
      parameters:
      - $ref: '#/components/parameters/conversation_id'
      - $ref: '#/components/parameters/include_events'
      - $ref: '#/components/parameters/output_channel'
      - in: query
        name: execute_side_effects
        schema:
          type: boolean
          default: False
          description: >-
            If `true`, any ``BotUttered`` event will be forwarded to the
            channel specified in the ``output_channel`` parameter. Any
            ``ReminderScheduled`` or ``ReminderCancelled`` event will also be
            processed.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
              - $ref: '#/components/schemas/Event'
              - type: array
                items:
                  $ref: '#/components/schemas/Event'
      responses:
        200:
          $ref: '#/components/responses/200Tracker'
        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'

    put:
      security:
      - TokenAuth: []
      - JWT: []
      operationId: replaceConversationTrackerEvents
      tags:
      - Tracker
      summary: Replace a trackers events
      description: >-
        Replaces all events of a tracker with the passed
        list of events. This endpoint should not be used to
        modify trackers in a production setup, but rather
        for creating training data.
      parameters:
      - $ref: '#/components/parameters/conversation_id'
      - $ref: '#/components/parameters/include_events'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventList'
      responses:
        200:
          $ref: '#/components/responses/200Tracker'
        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'

  /conversations/{
   
   conversation_id}/story:
    get:
      security:
      - TokenAuth: []
      - JWT: []
      operationId: getConversationStory
      tags:
      - Tracker
      summary: Retrieve an end-to-end story corresponding to a conversation
      description: >-
        The story represents the whole conversation in end-to-end
        format. This can be posted to the '/test/stories' endpoint and used
        as a test.
      parameters:
      - $ref: '#/components/parameters/conversation_id'
      - $ref: '#/components/parameters/until'
      - $ref: '#/components/parameters/all_sessions'
      responses:
        200:
          $ref: '#/components/responses/200Story'
        401:
          $ref: '#/components/responses/401NotAuthenticated'
        403:
          $ref: '#/components/responses/403NotAuthorized'
        409:
          $ref: '#/components/responses/409Conflict'
        500:
          $ref: '#/components/responses/500ServerError'

  /conversations/{
   
   conversation_id}/execute:
    post:
      security:
      - TokenAuth: []
      - JWT: []
      operationId: executeConversationAction
      tags:
      - Tracker
      summary: Run an action in a conversation
      deprecated: true
      description: >-
        DEPRECATED. Runs the action, calling the action server if necessary.
        Any responses sent by the executed action will be forwarded
        to the channel specified in the output_channel parameter.
        If no output channel is specified, any messages that should be
        sent to the user will be included in the response of this endpoint.
      parameters:
      - $ref: '#/components/parameters/conversation_id'
      - $ref: '#/components/parameters/include_events'
      - $ref: '#/components/parameters/output_channel'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActionRequest'
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  tracker:
                    $ref: '#/components/schemas/Tracker'
                  messages:
                    type: array
                    items:
                      $ref: '#/components/schemas/BotMessage'
        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'

  /conversations/{
   
   conversation_id}/trigger_intent:
    post:
      security:
        - TokenAuth: []
        - JWT: []
      operationId: triggerConversationIntent
      tags:
        - Tracker
      summary: Inject an intent into a conversation
      description: >-
        Sends a specified intent and list of entities in place of a
        user message. The bot then predicts and executes a response action.
        Any responses sent by the executed action will be forwarded
        to the channel specified in the ``output_channel`` parameter.
        If no output channel is specified, any messages that should be
        sent to the user will be included in the response of this endpoint.
      parameters:
        - $ref: '#/components/parameters/conversation_id'
        - $ref: '#/components/parameters/include_events'
        - $ref: '#/components/parameters/output_channel'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IntentTriggerRequest'
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  tracker:
                    $ref: '#/components/schemas/Tracker'
                  messages:
                    type: array
                    <
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

great-wind

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值