Skip to main content

Overview

ClaimExtractor turns the last message of a conversation into claims, each tagged with one of four subtypes, and into the intents the user states. On the hosted API it runs on our servers: you send the conversation and get the extractions back, with nothing to download or serve.

The hosted API serves one model, claim-extractor-pro-2605, the Pro version of ClaimExtractor, not published on Hugging Face. It is the default over HTTP; from Python, name it in model, since the library defaults to an open model the hosted API does not serve.

See it in the PlaygroundExample conversations, each with what ClaimExtractor returned.

Quickstart​

Once your LLM has replied, send the conversation with that reply as its last message. You need an API key:

Setup
pip install orbitals # Python 3.10 or later
export PRINCIPLED_API_KEY="principled_..."
first_call.py
from orbitals.claim_extractor import ClaimExtractor

ce = ClaimExtractor(
backend="api",
api_url="https://api.orbitals.principled.app",
model="claim-extractor-pro-2605",
)

output = ce.extract(
[
{"role": "user", "content": "Do you offer express delivery to Milan?"},
{
"role": "assistant",
"content": (
"Yes: express delivery to Milan costs 9.90 euros "
"and arrives the next business day. "
"I can also upgrade an order you already placed, "
"if you send me its tracking number."
),
},
],
)

for claim in output.extractions.claims:
print(claim.subtype, claim.content)
Run it
$ python first_call.py
Factoid Express delivery to Milan costs 9.90 euros.
Factoid Express delivery to Milan arrives the next business day.
Capability The AI service can upgrade an order the user already placed to express delivery, given its tracking number.

No AI service description here: ClaimExtractor does not need one. Every other field and endpoint is in the Reference.