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]: Testing for OpenTelemetry Instrumentation for monitoring AI Applications (#521)

Patcherd456b168a82d
diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml
index f8cd0df1..ae886b70 100644
--- a/sdk/python/pyproject.toml
+++ b/sdk/python/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "openlit"
-version = "1.32.1"
+version = "1.32.0"
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/tests/requirements.txt b/sdk/python/tests/requirements.txt
index 85957e0c..09f1bf94 100644
--- a/sdk/python/tests/requirements.txt
+++ b/sdk/python/tests/requirements.txt
@@ -19,7 +19,6 @@ elevenlabs
google-generativeai
azure-ai-inference
reka-api
-premai
multion
mem0ai
diff --git a/sdk/python/tests/test_embedchain.py b/sdk/python/tests/test_embedchain.py
index 8c29a3a1..e6e8a98a 100644
--- a/sdk/python/tests/test_embedchain.py
+++ b/sdk/python/tests/test_embedchain.py
@@ -2,10 +2,12 @@
"""
This module contains tests for Embedchain functionality using the embedchain Python library.
-Tests cover various functions, including WebBaseLoader, TextSplitter,
-and Prompt pull from Hub.
+Tests cover various functions of embedchain.
These tests validate integration with OpenLIT.
+Environment Variables:
+ - OPENAI_API_KEY: OpenAI API key for authentication.
+
Note: Ensure the environment is properly configured for Embedchain and OpenLIT monitoring
prior to running these tests.
"""
@@ -15,8 +17,10 @@ from embedchain import App
import openlit
# Initialize environment and application name for OpenLIT monitoring
-openlit.init(environment="openlit-testing", application_name="openlit-python-test")
-os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_TOKEN")
+openlit.init(
+ environment="openlit-python-testing",
+ application_name="openlit-python-embedchain-test"
+)
config = {
'app': {
diff --git a/sdk/python/tests/test_mistral.py b/sdk/python/tests/test_mistral.py
index 3dda3526..0904fe07 100644
--- a/sdk/python/tests/test_mistral.py
+++ b/sdk/python/tests/test_mistral.py
@@ -1,4 +1,4 @@
-# pylint: disable=duplicate-code
+# pylint: disable=duplicate-code, no-name-in-module
"""
This module contains tests for Mistral functionality using the Mistral Python library.
@@ -12,12 +12,15 @@ Note: Ensure the environment is properly configured for Mistral access and OpenL
prior to running these tests.
"""
+import os
import pytest
from mistralai import Mistral
import openlit
# Initialize synchronous Mistral client
-client = Mistral()
+client = Mistral(
+ api_key=os.getenv("MISTRAL_API_KEY"),
+)
# Initialize environment and application name for OpenLIT monitoring
openlit.init(environment="openlit-python-testing", application_name="openlit-python-mistral-test")
diff --git a/sdk/python/tests/test_multion.py b/sdk/python/tests/test_multion.py
index 0db60476..f1e216b0 100644
--- a/sdk/python/tests/test_multion.py
+++ b/sdk/python/tests/test_multion.py
@@ -1,4 +1,4 @@
-# pylint: disable=duplicate-code, no-name-in-module
+# pylint: disable=duplicate-code, no-name-in-module, import-error, no-member
"""
This module contains tests for MultiOn functionality using the MultiOn Python library.
@@ -57,7 +57,7 @@ async def test_async_multion_browse():
"""
try:
- response = async_client.browse(
+ response = await async_client.browse(
url="https://docs.openlit.io",
cmd="say hi"
)
diff --git a/sdk/python/tests/test_prem.py b/sdk/python/tests/test_prem.py.hold
similarity index 100%
rename from sdk/python/tests/test_prem.py
rename to sdk/python/tests/test_prem.py.hold
diff --git a/sdk/python/tests/test_xai.py b/sdk/python/tests/test_xai.py
index 476f9e6d..9297861d 100644
--- a/sdk/python/tests/test_xai.py
+++ b/sdk/python/tests/test_xai.py
@@ -60,7 +60,7 @@ async def test_async_xai_chat_completions():
AssertionError: If the chat completion response object is not as expected.
"""
- response = async_client.chat.completions.create(
+ response = await async_client.chat.completions.create(
model="grok-beta",
messages=[
{"role": "user", "content": "Hi"},