From 26966b00d7b8a194ed6731b4ae0592dbc8ab9ee0 Mon Sep 17 00:00:00 2001 From: Alexander Song Date: Tue, 30 Jan 2024 13:07:22 -0800 Subject: [PATCH] remove output value and mime type for retriever spans --- .../src/openinference/instrumentation/dspy/__init__.py | 4 ---- .../instrumentation/dspy/test_instrumentor.py | 8 -------- 2 files changed, 12 deletions(-) diff --git a/python/instrumentation/openinference-instrumentation-dspy/src/openinference/instrumentation/dspy/__init__.py b/python/instrumentation/openinference-instrumentation-dspy/src/openinference/instrumentation/dspy/__init__.py index 7a9d00ac7..d6b8bad8d 100644 --- a/python/instrumentation/openinference-instrumentation-dspy/src/openinference/instrumentation/dspy/__init__.py +++ b/python/instrumentation/openinference-instrumentation-dspy/src/openinference/instrumentation/dspy/__init__.py @@ -295,10 +295,6 @@ def __call__( dict( _flatten( { - SpanAttributes.OUTPUT_VALUE: json.dumps( - prediction, cls=DSPyJSONEncoder - ), - SpanAttributes.OUTPUT_MIME_TYPE: OpenInferenceMimeTypeValues.JSON.value, SpanAttributes.RETRIEVAL_DOCUMENTS: [ { DocumentAttributes.DOCUMENT_ID: str(uuid4()), diff --git a/python/instrumentation/openinference-instrumentation-dspy/tests/openinference/instrumentation/dspy/test_instrumentor.py b/python/instrumentation/openinference-instrumentation-dspy/tests/openinference/instrumentation/dspy/test_instrumentor.py index 5fe4a7456..c2ebe8952 100644 --- a/python/instrumentation/openinference-instrumentation-dspy/tests/openinference/instrumentation/dspy/test_instrumentor.py +++ b/python/instrumentation/openinference-instrumentation-dspy/tests/openinference/instrumentation/dspy/test_instrumentor.py @@ -218,14 +218,6 @@ def forward(self, question): "query_or_queries": "What's the capital of the United States?" } assert span.attributes[INPUT_MIME_TYPE] == JSON.value - assert json.loads(span.attributes[OUTPUT_VALUE]) == { - "passages": [ - "first retrieved document text", - "second retrieved document text", - "third retrieved document text", - ] - } - assert span.attributes[OUTPUT_MIME_TYPE] == JSON.value assert isinstance( span.attributes[f"{RETRIEVAL_DOCUMENTS}.0.{DOCUMENT_ID}"], str,