diff --git a/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py b/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py index 24ea52decb..3dbe9fd7f3 100644 --- a/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py +++ b/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py @@ -137,11 +137,18 @@ class SpanAttributes: # Watson/genai LLM GEN_AI_WATSONX_DECODING_METHOD = "llm.watsonx.decoding_method" + GEN_AI_WATSONX_RANDOM_SEED = "llm.watsonx.random_seed" GEN_AI_WATSONX_MAX_NEW_TOKENS = "llm.watsonx.max_new_tokens" GEN_AI_WATSONX_MIN_NEW_TOKENS = "llm.watsonx.min_new_tokens" GEN_AI_WATSONX_REPETITION_PENALTY = "llm.watsonx.repetition_penalty" + # External work receipt references (opt-in) - see issue 4340 + AIPOU_WORK_RECEIPT_ID = "aipou.work_receipt_id" + AIPOU_EVIDENCE_CLASS = "aipou.evidence_class" + AIPOU_SCHEME = "aipou.scheme" + AIPOU_VALIDATION_STATUS = "aipou.validation_status" + # ----------------------------------------------------------------------- # Legacy LLM_* aliases (old names with original string values) # These constants were removed or renamed in v0.5.0. diff --git a/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/_testing.py b/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/_testing.py index 3f74ae78f0..19f5323d09 100644 --- a/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/_testing.py +++ b/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/_testing.py @@ -439,3 +439,27 @@ def test_watsonx_metrics_kept(self): assert Meters.LLM_WATSONX_COMPLETIONS_EXCEPTIONS == "llm.watsonx.completions.exceptions" assert Meters.LLM_WATSONX_COMPLETIONS_RESPONSES == "llm.watsonx.completions.responses" assert Meters.LLM_WATSONX_COMPLETIONS_TOKENS == "llm.watsonx.completions.tokens" +# --------------------------------------------------------------------------- +# SpanAttributes — AIPOU external work-receipt reference (opt-in, issue #4340) +# --------------------------------------------------------------------------- + + +class TestSpanAttributesAIPOU: + """ + AIPOU (AI Proof of Us) work-receipt reference attributes. These are opt-in: + traces may carry a reference to an externally-issued, externally-validated + work receipt, but tracing must never derive or validate the receipt itself. + """ + + def test_aipou_work_receipt_id(self): + assert SpanAttributes.AIPOU_WORK_RECEIPT_ID == "aipou.work_receipt_id" + + def test_aipou_evidence_class(self): + assert SpanAttributes.AIPOU_EVIDENCE_CLASS == "aipou.evidence_class" + + def test_aipou_scheme(self): + assert SpanAttributes.AIPOU_SCHEME == "aipou.scheme" + + def test_aipou_validation_status(self): + assert SpanAttributes.AIPOU_VALIDATION_STATUS == "aipou.validation_status" +