From b786bc7fcd4953c7ef9598994992eacfa8d337a0 Mon Sep 17 00:00:00 2001 From: Teo Date: Mon, 30 Dec 2024 07:21:00 +0100 Subject: [PATCH] remove devin test timing out CI Signed-off-by: Teo --- .../test_openai_integration.py | 69 ------------------- 1 file changed, 69 deletions(-) delete mode 100644 tests/openai_handlers/test_openai_integration.py diff --git a/tests/openai_handlers/test_openai_integration.py b/tests/openai_handlers/test_openai_integration.py deleted file mode 100644 index 8b2a0fecf..000000000 --- a/tests/openai_handlers/test_openai_integration.py +++ /dev/null @@ -1,69 +0,0 @@ -import pytest -import agentops -import asyncio -from openai import OpenAI, AsyncOpenAI -from dotenv import load_dotenv -import os - -load_dotenv() - - -@pytest.mark.integration -def test_openai_integration(): - """Integration test demonstrating all four OpenAI call patterns: - 1. Sync (non-streaming) - 2. Sync (streaming) - 3. Async (non-streaming) - 4. Async (streaming) - - Verifies that AgentOps correctly tracks all LLM calls via analytics. - """ - # Initialize AgentOps without auto-starting session - agentops.init(auto_start_session=False) - session = agentops.start_session() - - def sync_no_stream(): - client = OpenAI(api_key=os.getenv("OPENAI_API_KEY")) - client.chat.completions.create( - model="gpt-4o-mini", - messages=[{"role": "user", "content": "Hello from sync no stream"}], - ) - - def sync_stream(): - client = OpenAI(api_key=os.getenv("OPENAI_API_KEY")) - stream_result = client.chat.completions.create( - model="gpt-4o-mini", - messages=[{"role": "user", "content": "Hello from sync streaming"}], - stream=True, - ) - for _ in stream_result: - pass - - async def async_no_stream(): - client = AsyncOpenAI(api_key=os.getenv("OPENAI_API_KEY")) - await client.chat.completions.create( - model="gpt-4o-mini", - messages=[{"role": "user", "content": "Hello from async no stream"}], - ) - - async def async_stream(): - client = AsyncOpenAI(api_key=os.getenv("OPENAI_API_KEY")) - async_stream_result = await client.chat.completions.create( - model="gpt-4o-mini", - messages=[{"role": "user", "content": "Hello from async streaming"}], - stream=True, - ) - async for _ in async_stream_result: - pass - - # Call each function - sync_no_stream() - sync_stream() - asyncio.run(async_no_stream()) - asyncio.run(async_stream()) - - session.end_session("Success") - analytics = session.get_analytics() - print(analytics) - # Verify that all LLM calls were tracked - assert analytics["LLM calls"] >= 4, f"Expected at least 4 LLM calls, but got {analytics['LLM calls']}"