Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

[Fix]: Handle KeyError for OpenAI tool calls with no content (#769)

ChrisBlaa819182f51625
diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml
index ae426cb1..5ac8e837 100644
--- a/sdk/python/pyproject.toml
+++ b/sdk/python/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "openlit"
-version = "1.34.6"
+version = "1.34.7"
description = "OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications and GPUs, facilitating the integration of observability into your GenAI-driven projects"
authors = ["OpenLIT"]
license = "Apache-2.0"
diff --git a/sdk/python/src/openlit/instrumentation/openai/async_openai.py b/sdk/python/src/openlit/instrumentation/openai/async_openai.py
index 91cf7b54..eaf75c7e 100644
--- a/sdk/python/src/openlit/instrumentation/openai/async_openai.py
+++ b/sdk/python/src/openlit/instrumentation/openai/async_openai.py
@@ -733,7 +733,7 @@ def async_chat_completions(version, environment, application_name,
formatted_messages = []
for message in message_prompt:
role = message["role"]
- content = message["content"]
+ content = message.get("content", "")
if isinstance(content, list):
content_str = ", ".join(