| |
| """Simple script to talk to Elizabeth through API""" |
|
|
| import requests |
| import json |
|
|
| def talk_to_elizabeth(message): |
| """Send message to Elizabeth and get response""" |
| url = "http://localhost:8000/v1/chat/completions" |
| headers = { |
| "Authorization": "Bearer elizabeth-secret-key-2025", |
| "Content-Type": "application/json" |
| } |
| |
| payload = { |
| "model": "qwen3-8b-elizabeth-simple", |
| "messages": [{"role": "user", "content": message}], |
| "max_tokens": 300 |
| } |
| |
| try: |
| response = requests.post(url, headers=headers, json=payload, timeout=30) |
| if response.status_code == 200: |
| result = response.json() |
| return result['choices'][0]['message']['content'] |
| else: |
| return f"Error: {response.status_code} - {response.text}" |
| except Exception as e: |
| return f"Exception: {e}" |
|
|
| if __name__ == "__main__": |
| print("🤖 Talking to Elizabeth...") |
| |
| |
| message = "Hello Elizabeth! This is Chase. I want to have a direct conversation with you." |
| print(f"💬 You: {message}") |
| |
| response = talk_to_elizabeth(message) |
| print(f"🤖 Elizabeth: {response}") |