#!/usr/bin/env python3
"""Test script for AirLLM with Nanobot"""
import sys
import traceback

print("Starting test...", file=sys.stderr)
print("Starting test...", file=sys.stdout)

try:
    from nanobot.providers.airllm_wrapper import create_ollama_client
    print("✓ Imported create_ollama_client", file=sys.stderr)
    
    print("Creating client with model path...", file=sys.stderr)
    client = create_ollama_client('/home/ladmin/.local/models/llama3.2-3b-instruct')
    print("✓ Client created", file=sys.stderr)
    
    print("Testing generate...", file=sys.stderr)
    result = client.generate('Hello, what is 2+5?', max_tokens=20)
    print(f"✓ Result: {result}", file=sys.stderr)
    print(result)
    
except Exception as e:
    print(f"✗ ERROR: {e}", file=sys.stderr)
    traceback.print_exc(file=sys.stderr)
    sys.exit(1)

