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 }
Checks if the generated output is grounded in the provided context.
Successful Response
The response is of type object.
object