Rivier/ Guides

Watch a question

Keep a question on watch and be told when its answer changes.

POST /monitor

Watch a question and be told when its answer changes. Rivier asks the question again on a schedule and compares the claims in the new answer with the last one. Making a watch needs the scope analytics:write; reading needs analytics:read.

FieldTypeMeaning
querystringRequired. The question to watch, 1 to 1,000 characters.
webhookUrlstringOptional. An https address that is sent the change and the new answer.

Request:

curl -sS https://api.rivier.ai/monitor \
  -H "Authorization: Bearer $RIVIER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "opening hours of the national library", "webhookUrl": "https://example.com/hooks/watch" }'

Response:

{
  "monitor_id": "…"
}

Routes

  • POST /monitor: Watch a question. Answers 201 with the id of the watch.
  • GET /monitor: The watched questions.
  • GET /monitor/{id}: One watched question with its last answer.
  • DELETE /monitor/{id}: Stop watching.

What a change looks like

When the answer changes, the address you gave is sent the claims that were added and removed, the change in confidence and the new answer with its sources.

Body:

{
  "monitor_id": "…",
  "diff": {
    "addedClaims": ["…"],
    "removedClaims": [],
    "confidenceDelta": -0.12
  },
  "answer": "…",
  "citations": [],
  "confidence": 0.71
}

Written and kept by Rivier. Read from https://rivier.ai/docs/monitor.md.

This page as Markdown