-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_gpt52_stop_seq.py
More file actions
48 lines (40 loc) · 1.45 KB
/
Copy pathtest_gpt52_stop_seq.py
File metadata and controls
48 lines (40 loc) · 1.45 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
"""Test script to reproduce gpt-5.2 stop sequence bug on Azure"""
import asyncio
import sys
sys.path.insert(0, '/Users/femtozheng/python-project/minion1')
from minion.configs.config import config
from minion.models.llm_client import LLMClient
async def test_gpt52():
# Load config
config.load_config('/Users/femtozheng/python-project/minion1/config/config.yaml')
# Test with stop sequence
client = LLMClient(config_name="gpt-5.2")
print("=" * 60)
print("Testing gpt-5.2 with stop sequence")
print("=" * 60)
# Test cases that might trigger stop sequence issues
test_messages = [
[{"role": "user", "content": "Say hello and stop after 'world'."}],
[{"role": "user", "content": "Count from 1 to 5, one number per line."}],
]
stop_sequences = [
["world"],
["\n\n"],
["5"],
]
for messages in test_messages:
for stop in stop_sequences:
print(f"\n--- Test: {messages[0]['content'][:40]}... | stop={stop} ---")
try:
response = await client.chat_completion(
messages=messages,
stop=stop,
max_tokens=100
)
print(f"Response: {response}")
except Exception as e:
print(f"ERROR: {type(e).__name__}: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
asyncio.run(test_gpt52())