Check For Product

POST

Check if a product mentioned in the question exists in the real world.

This endpoint uses a language model to assess whether a product described in the input question is likely to exist in reality. It makes multiple attempts to get a reliable result.

Parameters:

  • question: String containing the question or description of the product to check

Returns:

  • JSONResponse object with the following structure:
    • product_exists: Boolean indicating whether the product is likely to exist in the real world

Example Request:

{
"question": "Does a smartphone that can project holograms exist?"
}

Example Response:

1{
2 "product_exists": false
3}

Notes:

  • The check is performed using the GPT-4 language model
  • The endpoint makes up to 6 attempts to get a reliable result
  • The final result is based on the average of successful responses
  • A product is considered to exist if the average response is greater than 4 on a scale of 1-7

Raises:

  • HTTPException 404: If the language model service is unavailable after multiple attempts

Query parameters

questionstringRequired

Response

Successful Response