Create your first verifier

Login to NAVI admin app and create your first verifier.

Create verifier in dashboard

On the verifier create page specify the verifier name and upload you policy files. Currently, we support pdf, docx, and txt files. Click create and wait for the creation process to complete. Once done you should be redirected to the verifier playground.

All created verifiers can be found on the home page.

Use your verifier in playground

On the verifier playground, you can test your verifier specifying content for verification. This is the easiest way to test your verifier before integrating it into your application.

Call your verifier using API call

On the playground page, click Get Code button to get a sample python code to call your verifier from python. Alternatively, you can make an API call from API reference playground or get a sample code for curl, python and other languages.

To make an API call for a verifier you will need your API key, team ID under which the verifier was created, and verifier ID.

Create an API key

You can obtain your API key from the settings.

Keep your API key confidential! Avoid sharing it with others or exposing it in client-side code (such as browsers or apps). For production requests, ensure they are routed through your backend server, where the API key can be securely accessed from an environment variable or key management service.

Team ID

Team ID can be accessed from the settings page.

Verifier ID

Verifier ID can be accessed from the verifier playground page url or from the sample code generated when you click Get Code button. All created verifiers can be found on the home page.

Make a request

You can paste the command below into your terminal to run your first API request. Make sure to replace API_KEY with your secret API key, TEAM_ID with your team ID, and VERIFIER_ID with the verifier ID.

curl --request POST \
  --url https://api.naviml.com/v1/TEAM_ID/verify \
  --header 'Authorization: Bearer API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "messages": [
    {
      "content": "Hello World",
      "role": "user"
    }
  ],
  "verifiers": [
    {
      "id": "VERIFIER_ID",
      "parameters": {
        "threshold": 0.5
      },
      "type": "policy-verifier"
    }
  ],
  "explain": true
}'

You should get a response that is similar to this:

{
  "request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "action": "allow",
  "result": {
    "verifiers": [
      {
        "id": "VERIFIER_ID",
        "result": "Compliant",
        "explanation": {
          "text": "The content is compliant with the policy because it does not contain any contradictions to existing policies.",
        },
        "action": "allow",
        "details": null,
        "usage": {
          "prompt_tokens": 123,
          "completion_tokens": 123,
          "total_tokens": 123
        }
      }
    ],
    "action": "allow"
  }
}