API Service

Using the api service is quite easy.

Step 1: API Key Setup

First, get your API key at the Bespoke Console.

export BESPOKE_API_KEY=besoke-...

Step 2: Install Dependencies

Install the package:

pip install bespokelabs

Step 3: Run

import os
from bespokelabs import BespokeLabs

bl = BespokeLabs(
    # This is the default and can be omitted
    auth_token=os.environ.get("BESPOKE_API_KEY"),
)

response = bl.minicheck.factcheck.create(
    claim="claim",
    context="context",
)
print(response.support_prob)

Lot more information about the library is available at the bespokelabs pypi page.

Last updated