adaptai / platform /aiml /experiments /talk_to_elizabeth.py
ADAPT-Chase's picture
Add files using upload-large-folder tool
3e626a5 verified
raw
history blame
1.22 kB
#!/usr/bin/env python3
"""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...")
# Test message
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}")