from isaacus import Isaacus
# Create an Isaacus API client.
client = Isaacus(api_key="PASTE_YOUR_API_KEY_HERE")
# Download the GitHub terms of service as an example.
tos = client.get(path="https://examples.isaacus.com/github-tos.md", cast_to=str)
# Extract the governing law of the contract.
response = client.extractions.qa.create(
model="kanon-answer-extractor",
query="What is the governing law of this agreement?",
texts=[tos],
)
# Unpack the results.
extraction = response.extractions[0]
answer = extraction.answers[0]
# Print the answer.
print(f'Governing law of the contract: {answer.text} (confidence: {answer.score:.2%})')