File size: 1,674 Bytes
a963d65 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
#!/usr/bin/env python3
"""
Test script to verify Ollama connectivity fixes
"""
import sys
import os
sys.path.append('.')
from src.enhanced_codellama_processor import EnhancedCodeLlamaProcessor
import asyncio
async def test_ollama_fix():
print("π₯ Testing Enhanced CodeLlama Processor with Ollama fixes...")
# Initialize processor
processor = EnhancedCodeLlamaProcessor()
# Test simple medical text
test_text = "Patient has diabetes and hypertension. Blood pressure is 140/90."
print(f"π Testing text: {test_text}")
print("π Processing...")
try:
result = await processor.process_document(
medical_text=test_text,
document_type="clinical_note",
extract_entities=True,
generate_fhir=False
)
print("β
Processing successful!")
print(f"π Provider used: {result.get('provider_metadata', {}).get('provider_used', 'Unknown')}")
print(f"β±οΈ Processing time: {result.get('provider_metadata', {}).get('processing_time', 'Unknown')}")
print(f"π Entities found: {result.get('extraction_results', {}).get('entities_found', 0)}")
if result.get('extracted_data'):
print("π Sample extracted data available")
return True
except Exception as e:
print(f"β Processing failed: {e}")
return False
if __name__ == "__main__":
success = asyncio.run(test_ollama_fix())
if success:
print("\nπ Ollama connectivity fixes are working!")
sys.exit(0)
else:
print("\nβ Issues still exist")
sys.exit(1) |