AI observation examples
Language-specific examples for each supported additional AI observation category.
#Choose the relevant category
The JSON fields below are example business data, not a mandatory universal model schema. Send only information actually available at the step and necessary for your purpose. Not every service needs every category. Do not place synthetic example values in a production trace as if they were observed.
Python snippets assume an existing step, .NET snippets an observer and Java snippets an sdk with active context. See the language guides for lifecycle and scope.
from sigillum_finans import JsonData
# Illustrative values only; record your actual application data.
step.observe("ai", "model",
JsonData.raw('{"name":"demo-risk-model","version":"1","framework":"demonstration"}'))
step.observe("ai", "classification",
JsonData.raw('{"label":"review","score":0.81}'))
step.observe("ai", "retrieval",
JsonData.raw('{"query":"Payment limit","documents":[{"id":"POL-1","text":"Review threshold: 10000."}]}'))
step.observe("ai", "tool",
JsonData.raw('{"name":"threshold.lookup","input":{"currency":"TRY"},"output":{"threshold":10000}}'))
step.observe("ai", "embedding",
JsonData.raw('{"model":"illustrative-3d","dimensions":3,"vector":[0.2,0.5,0.1]}'))
step.observe("ai", "inference",
JsonData.raw('{"model":"demo-risk-model","input":{"amount":12500},"output":{"reviewRequired":true}}'))
step.observe("ai", "evaluation",
JsonData.raw('{"metric":"demo-consistency","value":1}'))
step.observe("ai", "policy",
JsonData.raw('{"name":"amount-threshold","version":"1","threshold":10000,"matched":true}'))
step.observe("ai", "explanation",
JsonData.raw('{"method":"explicit-rule","reason":"The amount exceeds the example review threshold."}'))// Illustrative values only; record your actual application data.
observer.Model("""{"name":"demo-risk-model","version":"1","framework":"demonstration"}"""u8.ToArray());
observer.Classification("""{"label":"review","score":0.81}"""u8.ToArray());
observer.Retrieval("""{"query":"Payment limit","documents":[{"id":"POL-1","text":"Review threshold: 10000."}]}"""u8.ToArray());
observer.Tool("""{"name":"threshold.lookup","input":{"currency":"TRY"},"output":{"threshold":10000}}"""u8.ToArray());
observer.Embedding("""{"model":"illustrative-3d","dimensions":3,"vector":[0.2,0.5,0.1]}"""u8.ToArray());
observer.Inference("""{"model":"demo-risk-model","input":{"amount":12500},"output":{"reviewRequired":true}}"""u8.ToArray());
observer.Evaluation("""{"metric":"demo-consistency","value":1}"""u8.ToArray());
observer.Policy("""{"name":"amount-threshold","version":"1","threshold":10000,"matched":true}"""u8.ToArray());
observer.Explanation("""{"method":"explicit-rule","reason":"The amount exceeds the example review threshold."}"""u8.ToArray());import java.nio.charset.StandardCharsets;
// Illustrative values only; record your actual application data.
sdk.ai("model",
"{\"name\":\"demo-risk-model\",\"version\":\"1\",\"framework\":\"demonstration\"}".getBytes(StandardCharsets.UTF_8));
sdk.ai("classification",
"{\"label\":\"review\",\"score\":0.81}".getBytes(StandardCharsets.UTF_8));
sdk.ai("retrieval",
"{\"query\":\"Payment limit\",\"documents\":[{\"id\":\"POL-1\",\"text\":\"Review threshold: 10000.\"}]}".getBytes(StandardCharsets.UTF_8));
sdk.ai("tool",
"{\"name\":\"threshold.lookup\",\"input\":{\"currency\":\"TRY\"},\"output\":{\"threshold\":10000}}".getBytes(StandardCharsets.UTF_8));
sdk.ai("embedding",
"{\"model\":\"illustrative-3d\",\"dimensions\":3,\"vector\":[0.2,0.5,0.1]}".getBytes(StandardCharsets.UTF_8));
sdk.ai("inference",
"{\"model\":\"demo-risk-model\",\"input\":{\"amount\":12500},\"output\":{\"reviewRequired\":true}}".getBytes(StandardCharsets.UTF_8));
sdk.ai("evaluation",
"{\"metric\":\"demo-consistency\",\"value\":1}".getBytes(StandardCharsets.UTF_8));
sdk.ai("policy",
"{\"name\":\"amount-threshold\",\"version\":\"1\",\"threshold\":10000,\"matched\":true}".getBytes(StandardCharsets.UTF_8));
sdk.ai("explanation",
"{\"method\":\"explicit-rule\",\"reason\":\"The amount exceeds the example review threshold.\"}".getBytes(StandardCharsets.UTF_8));#Inputs, outputs and original content
Use ObserveAiAsync, call_ai / call_ai_async and the Java AI call interfaces around the actual operation. When original bytes already exist, supply them through the attachment contract. Source/source represents institutional source material; Custom/custom represents additional business information. The source attachment example combines content and metadata.
#Business fields and observation identity
A transaction_id or service_id inside a payload cannot change the SDK-authorised identity. Sigillum manages observation relationships, seals and signatures. Add source-system business identities through the optional reference interface.
