synth-ai 0.1.0.dev26__py3-none-any.whl → 0.1.0.dev27__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- public_tests/test_sonnet_thinking.py +72 -0
- {synth_ai-0.1.0.dev26.dist-info → synth_ai-0.1.0.dev27.dist-info}/METADATA +1 -1
- {synth_ai-0.1.0.dev26.dist-info → synth_ai-0.1.0.dev27.dist-info}/RECORD +6 -6
- {synth_ai-0.1.0.dev26.dist-info → synth_ai-0.1.0.dev27.dist-info}/WHEEL +0 -0
- {synth_ai-0.1.0.dev26.dist-info → synth_ai-0.1.0.dev27.dist-info}/licenses/LICENSE +0 -0
- {synth_ai-0.1.0.dev26.dist-info → synth_ai-0.1.0.dev27.dist-info}/top_level.txt +0 -0
@@ -94,11 +94,83 @@ class TestSonnetThinking(unittest.TestCase):
|
|
94
94
|
print(f"Medium Effort Response:\n{response_medium}\n")
|
95
95
|
self.assertIsInstance(response_medium, str)
|
96
96
|
|
97
|
+
async def test_thinking_blocks_attributes(self):
|
98
|
+
"""Test to verify thinking blocks have the correct attributes and structure"""
|
99
|
+
messages = [
|
100
|
+
{"role": "system", "content": "You are a helpful AI assistant."},
|
101
|
+
{
|
102
|
+
"role": "user",
|
103
|
+
"content": "Please solve this math problem step by step: If a train travels at 60 mph for 2.5 hours, how far does it travel?",
|
104
|
+
},
|
105
|
+
]
|
106
|
+
|
107
|
+
print("\n=== Testing Thinking Blocks Structure ===")
|
108
|
+
try:
|
109
|
+
response = await self.lm.respond_async(messages=messages)
|
110
|
+
print(f"Response received successfully: {response[:100]}...")
|
111
|
+
self.assertIsInstance(response, str)
|
112
|
+
self.assertGreater(len(response), 0)
|
113
|
+
except AttributeError as e:
|
114
|
+
if "'TextBlock' object has no attribute 'value'" in str(e):
|
115
|
+
self.fail(
|
116
|
+
"TextBlock missing 'value' attribute - API response structure may have changed"
|
117
|
+
)
|
118
|
+
raise
|
119
|
+
|
120
|
+
async def test_thinking_blocks_with_structured_output(self):
|
121
|
+
"""Test thinking blocks with structured output to verify attribute handling"""
|
122
|
+
from pydantic import BaseModel
|
123
|
+
|
124
|
+
class SimpleResponse(BaseModel):
|
125
|
+
answer: str
|
126
|
+
explanation: str
|
127
|
+
|
128
|
+
messages = [
|
129
|
+
{"role": "system", "content": "You are a helpful AI assistant."},
|
130
|
+
{"role": "user", "content": "What is 2+2? Provide answer and explanation."},
|
131
|
+
]
|
132
|
+
|
133
|
+
print("\n=== Testing Thinking Blocks with Structured Output ===")
|
134
|
+
try:
|
135
|
+
response = await self.lm.respond_async(
|
136
|
+
messages=messages, response_model=SimpleResponse
|
137
|
+
)
|
138
|
+
print(f"Structured response received: {response}")
|
139
|
+
self.assertIsInstance(response, SimpleResponse)
|
140
|
+
self.assertTrue(hasattr(response, "answer"))
|
141
|
+
self.assertTrue(hasattr(response, "explanation"))
|
142
|
+
except AttributeError as e:
|
143
|
+
if "'TextBlock' object has no attribute 'value'" in str(e):
|
144
|
+
self.fail("TextBlock missing 'value' attribute in structured output")
|
145
|
+
raise
|
146
|
+
|
147
|
+
async def test_thinking_blocks_raw_response(self):
|
148
|
+
"""Test to examine the raw response structure from the API"""
|
149
|
+
messages = [
|
150
|
+
{"role": "system", "content": "You are a helpful AI assistant."},
|
151
|
+
{"role": "user", "content": "Count from 1 to 3."},
|
152
|
+
]
|
153
|
+
|
154
|
+
print("\n=== Testing Raw Response Structure ===")
|
155
|
+
try:
|
156
|
+
# Access the raw response if possible
|
157
|
+
response = await self.lm.respond_async(messages=messages)
|
158
|
+
print(f"Raw response type: {type(response)}")
|
159
|
+
print(f"Raw response content: {response}")
|
160
|
+
self.assertIsInstance(response, str)
|
161
|
+
except Exception as e:
|
162
|
+
print(f"Exception type: {type(e)}")
|
163
|
+
print(f"Exception message: {str(e)}")
|
164
|
+
raise
|
165
|
+
|
97
166
|
def test_all(self):
|
98
167
|
print("\nStarting Claude 3.7 Sonnet Thinking Tests...")
|
99
168
|
asyncio.run(self.test_thinking_response())
|
100
169
|
asyncio.run(self.test_thinking_structured_output())
|
101
170
|
asyncio.run(self.test_thinking_with_high_effort())
|
171
|
+
asyncio.run(self.test_thinking_blocks_attributes())
|
172
|
+
asyncio.run(self.test_thinking_blocks_with_structured_output())
|
173
|
+
asyncio.run(self.test_thinking_blocks_raw_response())
|
102
174
|
print("\nAll tests completed successfully!")
|
103
175
|
|
104
176
|
|
@@ -4,7 +4,7 @@ public_tests/test_all_structured_outputs.py,sha256=x7Gj5Ykpw8Ut_XlSOEBHRLJSagYSH
|
|
4
4
|
public_tests/test_models.py,sha256=7ZJ2HPDZWhcIeZDDu8Iyt5lOy1xpKpYHM8FzsyEKQmc,5703
|
5
5
|
public_tests/test_reasoning_models.py,sha256=twKNTrWyeTgtqSC2A4V0g79Uq_SjZiBeWp6ntJIAGNM,2779
|
6
6
|
public_tests/test_recursive_structured_outputs.py,sha256=Ne-9XwnOxN7eSpGbNHOpegR-sRj589I84T6y8Z_4QnA,5781
|
7
|
-
public_tests/test_sonnet_thinking.py,sha256=
|
7
|
+
public_tests/test_sonnet_thinking.py,sha256=XrV9Uxxl4T26zvgeycD7yPoPk2XR43A5bsRjejpEDKk,7003
|
8
8
|
public_tests/test_structured_outputs.py,sha256=MZitgGedFlvxeaVFzuDQb2xXs8apwvDLTINpGBfsTdM,3653
|
9
9
|
public_tests/test_synth_sdk.py,sha256=jqJHKpvBn9qj21P76z9onXfPg88jyUmBTKmdvCsQMk8,14885
|
10
10
|
synth_ai/__init__.py,sha256=2siivzLbT2r-EA7m91dcJB-6Vsurc5_sX3WiKf4_o8Y,198
|
@@ -47,11 +47,11 @@ synth_ai/zyk/lms/vendors/supported/deepseek.py,sha256=diFfdhPMO5bLFZxnYj7VT0v6jK
|
|
47
47
|
synth_ai/zyk/lms/vendors/supported/groq.py,sha256=Fbi7QvhdLx0F-VHO5PY-uIQlPR0bo3C9h1MvIOx8nz0,388
|
48
48
|
synth_ai/zyk/lms/vendors/supported/ollama.py,sha256=K30VBFRTd7NYyPmyBVRZS2sm0UB651AHp9i3wd55W64,469
|
49
49
|
synth_ai/zyk/lms/vendors/supported/together.py,sha256=Ni_jBqqGPN0PkkY-Ew64s3gNKk51k3FCpLSwlNhKbf0,342
|
50
|
-
synth_ai-0.1.0.
|
50
|
+
synth_ai-0.1.0.dev27.dist-info/licenses/LICENSE,sha256=ynhjRQUfqA_RdGRATApfFA_fBAy9cno04sLtLUqxVFM,1069
|
51
51
|
tests/test_agent.py,sha256=CjPPWuMWC_TzX1DkDald-bbAxgjXE-HPQvFhq2B--5k,22363
|
52
52
|
tests/test_recursive_structured_outputs.py,sha256=Ne-9XwnOxN7eSpGbNHOpegR-sRj589I84T6y8Z_4QnA,5781
|
53
53
|
tests/test_structured_outputs.py,sha256=J7sfbGZ7OeB5ONIKpcCTymyayNyAdFfGokC1bcUrSx0,3651
|
54
|
-
synth_ai-0.1.0.
|
55
|
-
synth_ai-0.1.0.
|
56
|
-
synth_ai-0.1.0.
|
57
|
-
synth_ai-0.1.0.
|
54
|
+
synth_ai-0.1.0.dev27.dist-info/METADATA,sha256=JMIUzbECFL7CJ1EJv-D7Waelv_KYwhI0WyhiyJJCxfI,2795
|
55
|
+
synth_ai-0.1.0.dev27.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
56
|
+
synth_ai-0.1.0.dev27.dist-info/top_level.txt,sha256=5GzJO9j-KbJ_4ppxhmCUa_qdhHM4-9cHHNU76yAI8do,42
|
57
|
+
synth_ai-0.1.0.dev27.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|