Skip to content

Commit a0a742e

Browse files
committed
Force fresh package install with cache busting
1 parent b743bc4 commit a0a742e

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

test_direct_evaluator.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Quick test of Direct evaluator with tools.py
4+
"""
5+
import asyncio
6+
import os
7+
from dotenv import load_dotenv
8+
9+
load_dotenv()
10+
11+
async def test_direct_evaluator():
12+
# Import from the CI/CD package
13+
try:
14+
from ld_aic_cicd.evaluators.direct import DirectEvaluator
15+
except ImportError:
16+
print("❌ ld-aic-cicd package not installed")
17+
print("Install with: uv pip install git+https://...@feature/user-friendly-setup")
18+
return
19+
20+
print("✅ DirectEvaluator imported successfully")
21+
22+
# Initialize evaluator
23+
try:
24+
evaluator = DirectEvaluator()
25+
print(f"✅ DirectEvaluator initialized")
26+
except Exception as e:
27+
print(f"❌ Failed to initialize: {e}")
28+
return
29+
30+
# Test with support-agent config
31+
print("\n🧪 Testing support-agent with tools...")
32+
result = await evaluator.evaluate_case(
33+
config_key="support-agent",
34+
test_input="What is LaunchDarkly?",
35+
context_attributes={
36+
"key": "test-user",
37+
"country": "US",
38+
"plan": "free"
39+
}
40+
)
41+
42+
print(f"\n📊 Result:")
43+
print(f" Variation: {result.variation}")
44+
print(f" Latency: {result.latency_ms:.0f}ms")
45+
print(f" Error: {result.error}")
46+
print(f" Response preview: {result.response[:200]}...")
47+
48+
await evaluator.cleanup()
49+
50+
if __name__ == "__main__":
51+
asyncio.run(test_direct_evaluator())

test_rl_query.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env python3
2+
"""Quick test to verify RL knowledge base queries work"""
3+
4+
import requests
5+
import json
6+
7+
API_URL = "http://localhost:8000"
8+
9+
# Test query from new test data
10+
query = "What is a Markov Decision Process and why is it important in reinforcement learning?"
11+
12+
print(f"Testing RL query: {query}\n")
13+
14+
try:
15+
response = requests.post(
16+
f"{API_URL}/chat",
17+
json={
18+
"message": query,
19+
"user_id": "test_user",
20+
"user_context": {"country": "US", "plan": "paid"}
21+
},
22+
timeout=30
23+
)
24+
25+
if response.status_code == 200:
26+
data = response.json()
27+
print(f"✅ Success!")
28+
print(f"\nResponse: {data['response'][:500]}...")
29+
print(f"\nVariation: {data.get('variation_key')}")
30+
print(f"Model: {data.get('model')}")
31+
32+
# Check if response mentions RL concepts
33+
response_lower = data['response'].lower()
34+
rl_terms = ['markov', 'mdp', 'state', 'action', 'reward', 'reinforcement']
35+
found_terms = [term for term in rl_terms if term in response_lower]
36+
37+
print(f"\nRL terms found: {found_terms}")
38+
39+
if len(found_terms) >= 3:
40+
print("✅ Response appears to be about RL!")
41+
else:
42+
print("⚠️ Response may not be about RL")
43+
else:
44+
print(f"❌ Error: {response.status_code}")
45+
print(response.text)
46+
47+
except Exception as e:
48+
print(f"❌ Error: {e}")

0 commit comments

Comments
 (0)