Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.
TypeScript agent-harnessagent-harness-engineeringai-engineeringai-observabilityamd-gpuclaude-codeclickhousecodexcoding-agentcoding-agentscursorgenaigpu-monitoringllm-observabilityllmopsnvidia-smiobservabilityopen-sourceopenaiopentelemetry
[Fix]: Use `general_tokens` instead of `openai_tokens` in LangChain chains (#542)
Bassel-Elwakilebcdcb6cbbf9
diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.tomlindex caca1ab0..c4c4bb53 100644--- a/sdk/python/pyproject.toml+++ b/sdk/python/pyproject.toml@@ -1,6 +1,6 @@[tool.poetry]name = "openlit"-version = "1.32.8"+version = "1.32.9"description = "OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications and GPUs, facilitating the integration of observability into your GenAI-driven projects"authors = ["OpenLIT"]repository = "https://github.com/openlit/openlit/tree/main/openlit/python"diff --git a/sdk/python/src/openlit/instrumentation/langchain/langchain.py b/sdk/python/src/openlit/instrumentation/langchain/langchain.pyindex 32279e83..cb063994 100644--- a/sdk/python/src/openlit/instrumentation/langchain/langchain.py+++ b/sdk/python/src/openlit/instrumentation/langchain/langchain.py@@ -523,9 +523,9 @@ def chat(gen_ai_endpoint, version, environment, application_name,doc.page_content for doc in response.get("input_documents", [])if isinstance(doc.page_content, str)]- input_tokens = sum(general_tokens(text, model) for text in input_texts)+ input_tokens = sum(general_tokens(text) for text in input_texts)output_text = response.get("output_text", "")- output_tokens = general_tokens(output_text, model)+ output_tokens = general_tokens(output_text)# Calculate cost of the operationcost = get_chat_model_cost(