Skip to main content
POST
/
search
/
groundedness
/
check
JavaScript
import PiClient from 'withpi';

const client = new PiClient({
  apiKey: 'My API Key',
});

const response = await client.search.groundedness.check({ context: 'context', output: 'output' });

console.log(response.hallucinations);
{
  "hallucinations": [
    {
      "explanation": "<string>",
      "output_text": "<string>"
    }
  ],
  "score": 123
}

Authorizations

x-api-key
string
header
required

Body

application/json
context
string
required

The context to check groundedness against.

output
string
required

The generated output to check for groundedness.

processing_strategy
enum<string>

The processing strategy to use for the groundedness check.

Available options:
speed_optimized,
balanced,
quality_optimized
query
string
default:""

The optional query that generated the output.

Response

Successful Response

hallucinations
HallucinationResult · object[]
required
score
number
required