synth-ai 0.1.0.dev27__py3-none-any.whl → 0.1.0.dev28__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 +39 -0
- synth_ai/zyk/lms/vendors/core/anthropic_api.py +2 -2
- {synth_ai-0.1.0.dev27.dist-info → synth_ai-0.1.0.dev28.dist-info}/METADATA +1 -1
- {synth_ai-0.1.0.dev27.dist-info → synth_ai-0.1.0.dev28.dist-info}/RECORD +7 -7
- {synth_ai-0.1.0.dev27.dist-info → synth_ai-0.1.0.dev28.dist-info}/WHEEL +0 -0
- {synth_ai-0.1.0.dev27.dist-info → synth_ai-0.1.0.dev28.dist-info}/licenses/LICENSE +0 -0
- {synth_ai-0.1.0.dev27.dist-info → synth_ai-0.1.0.dev28.dist-info}/top_level.txt +0 -0
@@ -157,10 +157,48 @@ class TestSonnetThinking(unittest.TestCase):
|
|
157
157
|
response = await self.lm.respond_async(messages=messages)
|
158
158
|
print(f"Raw response type: {type(response)}")
|
159
159
|
print(f"Raw response content: {response}")
|
160
|
+
|
161
|
+
# Add detailed response structure inspection
|
162
|
+
print("\nResponse Structure Details:")
|
163
|
+
print(f"Is string: {isinstance(response, str)}")
|
164
|
+
if hasattr(response, "content"):
|
165
|
+
for i, block in enumerate(response.content):
|
166
|
+
print(f"\nBlock {i}:")
|
167
|
+
print(f"Type: {block.type}")
|
168
|
+
print(f"Available attributes: {dir(block)}")
|
169
|
+
if hasattr(block, "text"):
|
170
|
+
print(f"Has .text: {block.text}")
|
171
|
+
if hasattr(block, "value"):
|
172
|
+
print(f"Has .value: {block.value}")
|
173
|
+
|
160
174
|
self.assertIsInstance(response, str)
|
161
175
|
except Exception as e:
|
162
176
|
print(f"Exception type: {type(e)}")
|
163
177
|
print(f"Exception message: {str(e)}")
|
178
|
+
print(f"Full exception details: {dir(e)}")
|
179
|
+
raise
|
180
|
+
|
181
|
+
async def test_thinking_blocks_structure(self):
|
182
|
+
"""Test specifically for thinking blocks structure"""
|
183
|
+
messages = [
|
184
|
+
{"role": "system", "content": "You are a helpful AI assistant."},
|
185
|
+
{"role": "user", "content": "What is 2+2?"},
|
186
|
+
]
|
187
|
+
|
188
|
+
print("\n=== Testing Thinking Blocks Structure ===")
|
189
|
+
try:
|
190
|
+
# Set high reasoning effort to trigger thinking
|
191
|
+
self.lm.lm_config["reasoning_effort"] = "high"
|
192
|
+
response = await self.lm.respond_async(messages=messages)
|
193
|
+
print(f"Response with thinking:\n{response}")
|
194
|
+
self.assertIsInstance(response, str)
|
195
|
+
self.assertGreater(len(response), 0)
|
196
|
+
except AttributeError as e:
|
197
|
+
print(f"Attribute Error Details:")
|
198
|
+
print(f"Error message: {str(e)}")
|
199
|
+
print(f"Error type: {type(e)}")
|
200
|
+
if hasattr(e, "__context__"):
|
201
|
+
print(f"Context: {e.__context__}")
|
164
202
|
raise
|
165
203
|
|
166
204
|
def test_all(self):
|
@@ -171,6 +209,7 @@ class TestSonnetThinking(unittest.TestCase):
|
|
171
209
|
asyncio.run(self.test_thinking_blocks_attributes())
|
172
210
|
asyncio.run(self.test_thinking_blocks_with_structured_output())
|
173
211
|
asyncio.run(self.test_thinking_blocks_raw_response())
|
212
|
+
asyncio.run(self.test_thinking_blocks_structure())
|
174
213
|
print("\nAll tests completed successfully!")
|
175
214
|
|
176
215
|
|
@@ -114,7 +114,7 @@ class AnthropicAPI(VendorBase):
|
|
114
114
|
thinking_blocks = [
|
115
115
|
block for block in response.content if block.type == "text"
|
116
116
|
]
|
117
|
-
api_result = thinking_blocks[-1].
|
117
|
+
api_result = thinking_blocks[-1].text if thinking_blocks else ""
|
118
118
|
|
119
119
|
used_cache_handler.add_to_managed_cache(
|
120
120
|
model, messages, lm_config=lm_config, output=api_result
|
@@ -196,7 +196,7 @@ class AnthropicAPI(VendorBase):
|
|
196
196
|
thinking_blocks = [
|
197
197
|
block for block in response.content if block.type == "text"
|
198
198
|
]
|
199
|
-
api_result = thinking_blocks[-1].
|
199
|
+
api_result = thinking_blocks[-1].text if thinking_blocks else ""
|
200
200
|
|
201
201
|
used_cache_handler.add_to_managed_cache(
|
202
202
|
model, messages, lm_config=lm_config, output=api_result
|
@@ -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=jZREMZ4JMDkBflqwJbzd-OQ4PUEjn5m4VgwjSCX04MQ,8749
|
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
|
@@ -36,7 +36,7 @@ synth_ai/zyk/lms/vendors/constants.py,sha256=zqCOyXZqo297wboR9EKVSkvpq6JCMSJyeso
|
|
36
36
|
synth_ai/zyk/lms/vendors/openai_standard.py,sha256=TJz1u6IcJ1KHjbofyHs0rlFa13smVXFTtqBSVqEYJqo,5818
|
37
37
|
synth_ai/zyk/lms/vendors/retries.py,sha256=m-WvAiPix9ovnO2S-m53Td5VZDWBVBFuHuSK9--OVxw,38
|
38
38
|
synth_ai/zyk/lms/vendors/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
39
|
-
synth_ai/zyk/lms/vendors/core/anthropic_api.py,sha256=
|
39
|
+
synth_ai/zyk/lms/vendors/core/anthropic_api.py,sha256=l75WSqR7pS0gNRI-x0GyTkz8UL40o9Q2xwK-Rq5pddk,12592
|
40
40
|
synth_ai/zyk/lms/vendors/core/gemini_api.py,sha256=Cp8BpSk1yCC3SYrEK1pFOnCdUc65XIPonFEirZ6W2rA,5395
|
41
41
|
synth_ai/zyk/lms/vendors/core/mistral_api.py,sha256=m11ItQ46VyyCUy6hv6mw5OmiqwHr07wV_NJVNnPHgiA,8080
|
42
42
|
synth_ai/zyk/lms/vendors/core/openai_api.py,sha256=700M0QfAxDZXAURnlY--ReEwIEPJPMCwY0JIpu4vptM,5881
|
@@ -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.dev28.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.dev28.dist-info/METADATA,sha256=HLddXeCXyIpgrBJSD8sQ4iKH7MmArT_-XhGhlVwv7tE,2795
|
55
|
+
synth_ai-0.1.0.dev28.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
56
|
+
synth_ai-0.1.0.dev28.dist-info/top_level.txt,sha256=5GzJO9j-KbJ_4ppxhmCUa_qdhHM4-9cHHNU76yAI8do,42
|
57
|
+
synth_ai-0.1.0.dev28.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|