-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_qwen_raw.py
More file actions
59 lines (48 loc) · 1.63 KB
/
test_qwen_raw.py
File metadata and controls
59 lines (48 loc) · 1.63 KB
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
54
55
56
57
58
59
#!/usr/bin/env python3
"""Test raw Qwen output to see what's being generated."""
import asyncio
import os
from qwen_cli import QwenCLI
async def test_raw_output():
"""Test raw Qwen output without filtering."""
print("Testing raw Qwen output...")
# Initialize Qwen CLI
qwen = QwenCLI()
# Test with a simple prompt
messages = [{"role": "user", "content": "What can you do to help with coding?"}]
print(f"Prompt: {messages[0]['content']}")
print("="*60)
print("Raw output from Qwen CLI:")
print("="*60)
full_response = ""
try:
async for chunk in qwen.stream_completion(
messages=messages,
model="qwen3-coder-plus",
temperature=0.7,
max_tokens=500
):
full_response += chunk
print(chunk, end='', flush=True)
except Exception as e:
print(f"\nError: {e}")
print("\n" + "="*60)
print("Full response collected:")
print("="*60)
print(full_response)
print("="*60)
# Check if XML is present
if "<" in full_response and ">" in full_response:
print("⚠️ XML tags detected in response")
else:
print("✅ No XML tags in response")
# Check for thinking patterns
if "The user is asking" in full_response or "Based on the system" in full_response:
print("💭 Thinking content detected in response")
else:
print("✅ No obvious thinking patterns")
if __name__ == "__main__":
# Set environment for testing
os.environ['DEBUG'] = '0'
os.environ['NODE_ENV'] = 'production'
asyncio.run(test_raw_output())