From 60a99faa6e0f5946d1d426a41e08abee4637bdba Mon Sep 17 00:00:00 2001 From: Roger Yang Date: Tue, 10 Dec 2024 10:36:42 -0800 Subject: [PATCH 1/3] ci: fix type check --- .../src/openinference/instrumentation/llama_index/_callback.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/instrumentation/openinference-instrumentation-llama-index/src/openinference/instrumentation/llama_index/_callback.py b/python/instrumentation/openinference-instrumentation-llama-index/src/openinference/instrumentation/llama_index/_callback.py index 1ad5f4326..14650f13c 100644 --- a/python/instrumentation/openinference-instrumentation-llama-index/src/openinference/instrumentation/llama_index/_callback.py +++ b/python/instrumentation/openinference-instrumentation-llama-index/src/openinference/instrumentation/llama_index/_callback.py @@ -502,7 +502,7 @@ def _get_span_kind(event_type: Optional[CBEventType]) -> OpenInferenceSpanKindVa def _message_payload_to_attributes(message: Any) -> Dict[str, Optional[str]]: if isinstance(message, ChatMessage): - message_attributes = { + message_attributes: dict[str, Any] = { MESSAGE_ROLE: message.role.value, MESSAGE_CONTENT: message.content, } From e4063d59414decc32bf5177fa723f05ab9713a44 Mon Sep 17 00:00:00 2001 From: Roger Yang Date: Tue, 10 Dec 2024 10:51:53 -0800 Subject: [PATCH 2/3] clean up --- python/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/tox.ini b/python/tox.ini index 8771198da..960fda7f4 100644 --- a/python/tox.ini +++ b/python/tox.ini @@ -57,7 +57,7 @@ commands_pre = openai-latest: uv pip install -U openai 'httpx<0.28' vertexai: uv pip install --reinstall {toxinidir}/instrumentation/openinference-instrumentation-vertexai[test] vertexai-latest: uv pip install -U vertexai 'httpx<0.28' - llama_index: uv pip install --reinstall {toxinidir}/instrumentation/openinference-instrumentation-llama-index[test] + llama_index: uv pip install --reinstall {toxinidir}/instrumentation/openinference-instrumentation-llama-index[test] 'httpx<0.28' llama_index-latest: uv pip install -U llama-index llama-index-core 'httpx<0.28' dspy: uv pip install --reinstall {toxinidir}/instrumentation/openinference-instrumentation-dspy[test] dspy-latest: uv pip install -U dspy-ai 'httpx<0.28' From f1d4ba57cd30c73d96a987fa4d6b371ffefa3691 Mon Sep 17 00:00:00 2001 From: Roger Yang Date: Tue, 10 Dec 2024 10:54:52 -0800 Subject: [PATCH 3/3] clean up --- .../src/openinference/instrumentation/llama_index/_callback.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/instrumentation/openinference-instrumentation-llama-index/src/openinference/instrumentation/llama_index/_callback.py b/python/instrumentation/openinference-instrumentation-llama-index/src/openinference/instrumentation/llama_index/_callback.py index 14650f13c..dfe87484d 100644 --- a/python/instrumentation/openinference-instrumentation-llama-index/src/openinference/instrumentation/llama_index/_callback.py +++ b/python/instrumentation/openinference-instrumentation-llama-index/src/openinference/instrumentation/llama_index/_callback.py @@ -502,7 +502,7 @@ def _get_span_kind(event_type: Optional[CBEventType]) -> OpenInferenceSpanKindVa def _message_payload_to_attributes(message: Any) -> Dict[str, Optional[str]]: if isinstance(message, ChatMessage): - message_attributes: dict[str, Any] = { + message_attributes: Dict[str, Any] = { MESSAGE_ROLE: message.role.value, MESSAGE_CONTENT: message.content, }