Mrcs

MRC related APIs

ドキュメント検索ユーザーフィードバック

post

ドキュメントの検索結果に対するユーザーフィードバックを取得する。

Authorizations
Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Body
answerHashstringRequired

クエリに対してフィードバックを与えるまたは削除するために利用するドキュメント検索結果のIDです。このIDはドキュメント検索が行われるたびに作成され、クエリと回答のペアに紐付けられます。上記のドキュメント情報を取得するためのAPIを使用してIDを取得できます。

answerstringRequired

質問に対するドキュメントからの回答

idstringRequired

抽出されたドキュメントのID

positiveboolean | nullableOptional

値がtrueの場合、クエリに対する回答に対して肯定的なフィードバックが与えられます。値がfalseの場合、否定的なフィードバックが与えられます。値がnullの場合、フィードバックはキャンセルされます。

querystringRequired

抽出された検索結果に対してフィードバックを与えたり削除するクエリ

Responses
200

OK

application/json
post
POST /webapi/mrc/user_feedback HTTP/1.1
Host: backend-ja.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 80

{
  "answerHash": "text",
  "answer": "text",
  "id": "text",
  "positive": true,
  "query": "text"
}
200

OK

{
  "result": {
    "userFeedback": {
      "positiveCount": 1,
      "negativeCount": 1
    }
  }
}

ドキュメント検索に対して与えられたフィードバックを取得する

get

このAPIを使用することで、各検索クエリに対して、ドキュメント検索の結果(アップロードされたドキュメントからAIが抽出した回答)に対して与えられたフィードバックのリストを取得できます。

Authorizations
Query parameters
offsetintegerOptional

offset allows you to specify the ranking number of the first item on the page.

limitintegerOptional

limit allows you to set the number of objects returned on one page. The maximum value is 100.

Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Responses
200

取得に成功しました。

application/json
get
GET /webapi/mrc_feedbacks HTTP/1.1
Host: backend-ja.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
200

取得に成功しました。

{
  "result": [
    {
      "query": "text",
      "feedbacks": [
        {
          "document_id": "text",
          "answer": "text",
          "answer_hash": "text",
          "positive": true
        }
      ]
    }
  ],
  "count": 1
}

ドキュメント検索フィードバック

post

このAPIを使用すると、検索クエリに対するドキュメント検索結果に付けられたフィードバックを付与または取り消すことができます。

Authorizations
Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Body
querystringRequired

抽出された検索結果に対してフィードバックを与えるまたはキャンセルしたいクエリ。

idstringRequired

答えが抽出された文書のID。

answerHashstringRequired

クエリに対してフィードバックを与えたりキャンセルしたいドキュメント検索結果のIDです。これはドキュメント検索が行われるたびに作成され、クエリと回答のペアに結び付けられます。このIDは上記のドキュメントAPIを使用して取得できます。

isPositiveboolean | nullableOptional

値が真の場合、クエリに対する抽出された答えに肯定的なフィードバックが与えられます。値が偽の場合、否定的なフィードバックが与えられます。値がnullの場合、フィードバックが取り消されます。

Responses
200

フィードバックが正常に送信されました。

application/json
post
POST /webapi/mrc_feedback HTTP/1.1
Host: backend-ja.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 66

{
  "query": "text",
  "id": "text",
  "answerHash": "text",
  "isPositive": true
}
200

フィードバックが正常に送信されました。

{
  "result": {
    "mrcFeedbackSearchResult": {
      "agentFeedback": {
        "positiveCount": 1,
        "negativeCount": 1
      }
    }
  },
  "errors": {}
}

ドキュメント履歴を問い合わせ

get

過去に行われたドキュメント検索を返しますが、それはREST APIとAlliダッシュボードの両方を通じて行われたものです。

Authorizations
Query parameters
searchTermstringOptional

The term that should have appeared in the query

orderstringOptional

Can either be DESC (meaning latest queries come first), or ASC (meaning earliest queries come first)

endDatestringOptional

The latest date from which you want to get history (dates should be in the form YYYY-MM-DD)

startDatestringOptional

The earliest date from which you want to get history (dates should be in the form YYYY-MM-DD)

limitintegerOptional

A limit on the number of results to show (used for pagination)

offsetintegerOptional

In the list of all results, the index from which to start listing results (used for pagination)

Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Responses
200

OK

application/json
get
GET /webapi/mrc_histories HTTP/1.1
Host: backend-ja.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
200

OK

{
  "result": {
    "histories": [
      {
        "agent": {
          "id": "text"
        },
        "question": "text",
        "answers": [
          {
            "knowledgeBase": {
              "id": "text",
              "fileName": "text"
            },
            "answer": "text",
            "answerHash": "text",
            "answerFormat": "text",
            "hashtags": [
              "text"
            ],
            "feedbackAvailable": true,
            "columnFilterValues": [
              "text"
            ]
          }
        ]
      }
    ],
    "count": 1
  },
  "errors": {}
}

Was this helpful?