Views
No views yet

1pip install 'orbitals[claim-extractor-vllm]'
2
3# Or, if you'd like to use hf as a backend
4# pip install 'orbitals[claim-extractor-hf]'1from orbitals.claim_extractor import ClaimExtractor
2
3ce = ClaimExtractor(backend="vllm", model="claim-extractor-q")
4
5ai_service_description = """
6You are a virtual assistant for a parcel delivery service.
7You can only answer questions about package tracking.
8"""
9
10assistant_message = (
11 "Your package with tracking number 1234567890 is currently in transit and "
12 "is expected to be delivered on December 12, 2025. If you want, I can also "
13 "notify you when it is out for delivery."
14)
15
16result = ce.extract(
17 assistant_message,
18 ai_service_description=ai_service_description,
19)
20
21for claim in result.extractions.claims:
22 print(f"[{claim.subtype}] {claim.content}")
23
24for intent in result.extractions.intents:
25 print(f"[Intent] {intent.content}")
26
27# [Factoid] The tracking number of the user's package is 1234567890
28# [Factoid] The user's package is expected to be delivered on December 12, 2025
29# [Capability] The parcel delivery virtual assistant can notify the user when the package is out for delivery1from orbitals.types import AIServiceDescription
2from orbitals.claim_extractor import ClaimExtractor
3
4ce = ClaimExtractor(backend="vllm", model="claim-extractor-q")
5
6ai_service_description = AIServiceDescription(
7 identity_role=(
8 "You are PackAssist, a virtual assistant designed to help users understand and "
9 "track their parcel shipments. Your objective is to interpret tracking data and "
10 "guide users through delivery-related questions."
11 ),
12 context=(
13 "The service operates within a parcel-delivery environment where users interact "
14 "to check the status of shipments sent domestically or internationally. Typical "
15 "users are customers awaiting deliveries or sending parcels."
16 ),
17 functionalities=(
18 "Retrieve tracking updates; explain the meaning of tracking events; provide "
19 "estimated delivery windows; assist users in understanding delays or routing steps."
20 ),
21 knowledge_scope=(
22 "Public tracking information, standard logistics workflows, typical transit times, "
23 "and general procedures for parcel movement."
24 ),
25 principles=(
26 "Cannot modify shipments, initiate refunds, open claims, contact drivers, or view "
27 "internal logistics notes. Limited strictly to interpreting publicly available "
28 "tracking data."
29 ),
30 website_url="https://www.trackmate-delivery.com",
31)
32
33assistant_message = (
34 "Your package with tracking number 1234567890 is currently in transit and "
35 "is expected to be delivered on December 12, 2025. If you want, I can also "
36 "notify you when it is out for delivery."
37)
38
39result = ce.extract(assistant_message, ai_service_description=ai_service_description)
40
41for claim in result.extractions.claims:
42 print(f"[{claim.subtype}] {claim.content}")AIServiceDescription (rather than a free-form string) noticeably improves extraction quality, especially the precision of Capability claims and the grounding of Factoid claims in service-specific vocabulary.AIServiceDescription object. Optional, but strongly improves quality.ClaimExtractorOutput whose extractions field contains:claims: a list of Claim(subtype, content, evidences) objectsintents: a list of Intent(content, evidences) objectsNote on evidences. EveryClaimandIntentis designed to carry a list ofevidences— verbatim excerpts from the source message that support the extraction. The current open release does not populate evidences yet; that capability ships with the next model release. The output schema will not change —evidenceswill simply start being populated.
Factoid claims and verify them against authoritative data sources (CRM, knowledge bases, product catalogs).Capability claims made by an assistant match what the underlying system can actually do (preventing "phantom promises" that the assistant cannot fulfil).Intent extracted from the last user message as the routing signal for downstream tools, agents, or human handoff.Unverifiable claims that pattern-match banned marketing language or unsupported product claims.orbitals integration enables vLLM with prefix caching, MTP speculative decoding, and language-model-only mode by default — tuned for the shape of claim-extraction traffic (long, repeated system prompts; short per-turn inputs).evidences — see the note above. Plan downstream consumers around an empty evidences list for now.