symbolicai 1.7.0__py3-none-any.whl → 1.7.1__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.
- symai/__init__.py +1 -1
- symai/backend/engines/neurosymbolic/engine_anthropic_claudeX_reasoning.py +31 -3
- symai/backend/mixin/anthropic.py +4 -0
- {symbolicai-1.7.0.dist-info → symbolicai-1.7.1.dist-info}/METADATA +1 -1
- {symbolicai-1.7.0.dist-info → symbolicai-1.7.1.dist-info}/RECORD +9 -9
- {symbolicai-1.7.0.dist-info → symbolicai-1.7.1.dist-info}/WHEEL +0 -0
- {symbolicai-1.7.0.dist-info → symbolicai-1.7.1.dist-info}/entry_points.txt +0 -0
- {symbolicai-1.7.0.dist-info → symbolicai-1.7.1.dist-info}/licenses/LICENSE +0 -0
- {symbolicai-1.7.0.dist-info → symbolicai-1.7.1.dist-info}/top_level.txt +0 -0
symai/__init__.py
CHANGED
|
@@ -369,6 +369,35 @@ class ClaudeXReasoningEngine(Engine, AnthropicMixin):
|
|
|
369
369
|
|
|
370
370
|
return NOT_GIVEN
|
|
371
371
|
|
|
372
|
+
def _build_thinking_config(self, thinking_arg, model):
|
|
373
|
+
if not thinking_arg or not isinstance(thinking_arg, dict):
|
|
374
|
+
return NOT_GIVEN, None
|
|
375
|
+
|
|
376
|
+
thinking_type = thinking_arg.get("type")
|
|
377
|
+
if thinking_type == "disabled":
|
|
378
|
+
return {"type": "disabled"}, None
|
|
379
|
+
|
|
380
|
+
if thinking_type == "adaptive":
|
|
381
|
+
if self.supports_adaptive_thinking(model):
|
|
382
|
+
return {"type": "adaptive"}, thinking_arg.get("effort")
|
|
383
|
+
UserMessage(
|
|
384
|
+
"Adaptive thinking is only supported for claude-opus-4-6; "
|
|
385
|
+
"falling back to manual thinking."
|
|
386
|
+
)
|
|
387
|
+
return {"type": "enabled", "budget_tokens": thinking_arg.get("budget_tokens", 1024)}, None
|
|
388
|
+
|
|
389
|
+
if thinking_type == "enabled" or "budget_tokens" in thinking_arg:
|
|
390
|
+
return {"type": "enabled", "budget_tokens": thinking_arg.get("budget_tokens", 1024)}, None
|
|
391
|
+
|
|
392
|
+
return NOT_GIVEN, None
|
|
393
|
+
|
|
394
|
+
def _merge_output_config_effort(self, output_config, adaptive_effort):
|
|
395
|
+
if adaptive_effort is None:
|
|
396
|
+
return output_config
|
|
397
|
+
if output_config == NOT_GIVEN:
|
|
398
|
+
return {"effort": adaptive_effort}
|
|
399
|
+
return {**output_config, "effort": adaptive_effort}
|
|
400
|
+
|
|
372
401
|
def _prepare_request_payload(self, argument):
|
|
373
402
|
kwargs = argument.kwargs
|
|
374
403
|
model = kwargs.get("model", self.model)
|
|
@@ -394,9 +423,7 @@ class ClaudeXReasoningEngine(Engine, AnthropicMixin):
|
|
|
394
423
|
stop = kwargs.get("stop", NOT_GIVEN)
|
|
395
424
|
temperature = kwargs.get("temperature", 1)
|
|
396
425
|
thinking_arg = kwargs.get("thinking", NOT_GIVEN)
|
|
397
|
-
thinking =
|
|
398
|
-
if thinking_arg and isinstance(thinking_arg, dict):
|
|
399
|
-
thinking = {"type": "enabled", "budget_tokens": thinking_arg.get("budget_tokens", 1024)}
|
|
426
|
+
thinking, adaptive_effort = self._build_thinking_config(thinking_arg, model)
|
|
400
427
|
top_p = kwargs.get(
|
|
401
428
|
"top_p", NOT_GIVEN if temperature is not None else 1
|
|
402
429
|
) # @NOTE:'You should either alter temperature or top_p, but not both.'
|
|
@@ -410,6 +437,7 @@ class ClaudeXReasoningEngine(Engine, AnthropicMixin):
|
|
|
410
437
|
max_tokens = kwargs.get("max_tokens", self.max_response_tokens)
|
|
411
438
|
response_format = kwargs.get("response_format", argument.prop.response_format)
|
|
412
439
|
output_config = self._build_output_config(response_format)
|
|
440
|
+
output_config = self._merge_output_config_effort(output_config, adaptive_effort)
|
|
413
441
|
|
|
414
442
|
if stop != NOT_GIVEN and not isinstance(stop, list):
|
|
415
443
|
stop = [stop]
|
symai/backend/mixin/anthropic.py
CHANGED
|
@@ -26,9 +26,13 @@ LONG_CONTEXT_1M_MODELS = {
|
|
|
26
26
|
"claude-opus-4-6",
|
|
27
27
|
"claude-sonnet-4-5",
|
|
28
28
|
}
|
|
29
|
+
ADAPTIVE_THINKING_MODELS = {"claude-opus-4-6"}
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
class AnthropicMixin:
|
|
33
|
+
def supports_adaptive_thinking(self, model: str) -> bool:
|
|
34
|
+
return model in ADAPTIVE_THINKING_MODELS
|
|
35
|
+
|
|
32
36
|
def supports_long_context_1m(self, model: str) -> bool:
|
|
33
37
|
return model in LONG_CONTEXT_1M_MODELS
|
|
34
38
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: symbolicai
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.1
|
|
4
4
|
Summary: A Neurosymbolic Perspective on Large Language Models
|
|
5
5
|
Author-email: Marius-Constantin Dinu <marius@extensity.ai>, Leoveanu-Condrei Claudiu <leo@extensity.ai>
|
|
6
6
|
License: BSD 3-Clause License
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
symai/TERMS_OF_SERVICE.md,sha256=HN42UXVI_wAVDHjMShzy_k7xAsbjXaATNeMKcIte_eg,91409
|
|
2
|
-
symai/__init__.py,sha256=
|
|
2
|
+
symai/__init__.py,sha256=dqtdpuxerRJnEAvdbiZOoLyIpWe-yiVDWB4V6HXYJIU,15612
|
|
3
3
|
symai/chat.py,sha256=DCEbmZ96wv-eitAVt6-oF6PT3JM3cT59Iy3r2Hucd_M,14100
|
|
4
4
|
symai/components.py,sha256=SsGl8Cs-AQcPZjFyTv4IB3ATz8evRiVwTBH7k2umVSo,75391
|
|
5
5
|
symai/constraints.py,sha256=ljjB9p0qK4DrDl_u5G_Y-Y6WAH5ZHANIqLLxRtwcORs,1980
|
|
@@ -40,7 +40,7 @@ symai/backend/engines/index/engine_vectordb.py,sha256=xXU8QaC2BX9O4dDjDCVYgWO4Px
|
|
|
40
40
|
symai/backend/engines/lean/engine_lean4.py,sha256=ln5nbQn5szq8nRulbREPLCPQ5bwjM_A5XAGMkfzPdT8,10102
|
|
41
41
|
symai/backend/engines/neurosymbolic/__init__.py,sha256=zEjkuxtzBQdxx-b1aXzooCatA43Rrlo9jAyZZfRYNzM,2608
|
|
42
42
|
symai/backend/engines/neurosymbolic/engine_anthropic_claudeX_chat.py,sha256=Y5AOCmJgL51QgrVbezSd0pe8GgMYNCuWWDIDES1_eaM,21133
|
|
43
|
-
symai/backend/engines/neurosymbolic/engine_anthropic_claudeX_reasoning.py,sha256=
|
|
43
|
+
symai/backend/engines/neurosymbolic/engine_anthropic_claudeX_reasoning.py,sha256=6jG0G9hUKDcT03_eIbwWrrlAGHWS3Qgadmfb_vLTg9E,24613
|
|
44
44
|
symai/backend/engines/neurosymbolic/engine_cerebras.py,sha256=zFnKKd_9iEL2S-4hKFMG4vPAK-fkSOkaUMJlZ5EvoF4,13387
|
|
45
45
|
symai/backend/engines/neurosymbolic/engine_deepseekX_reasoning.py,sha256=_k0hy5dUxkbNP9vgF4R780A6THtjfcCJ_xUnkPvPRNw,9299
|
|
46
46
|
symai/backend/engines/neurosymbolic/engine_google_geminiX_reasoning.py,sha256=pvsUNtWYwvFXt8EEy5ed0V4xE4EE0IZ4f7Uw5jV3OF0,28333
|
|
@@ -66,7 +66,7 @@ symai/backend/engines/text_to_speech/engine_openai.py,sha256=AtY0mDvIM_yZQ6AgYNX
|
|
|
66
66
|
symai/backend/engines/text_vision/engine_clip.py,sha256=hU9vsHtKPpQYEoESyjuGXOzMhUNhvspYMCNkCAqn2x8,3648
|
|
67
67
|
symai/backend/engines/userinput/engine_console.py,sha256=fDO6PRQI3NYZ_nHVXDFIsS9cFDRv3aTOfv8h5a360jc,743
|
|
68
68
|
symai/backend/mixin/__init__.py,sha256=LMeNSxy0Uwn3CSSImgGcRal7JpZqIxP9I1lw0C4sLJ0,1539
|
|
69
|
-
symai/backend/mixin/anthropic.py,sha256=
|
|
69
|
+
symai/backend/mixin/anthropic.py,sha256=78b9uFM2yosauHD-HAvIEhXtsD596ZuF6s2PQkMYsOI,3372
|
|
70
70
|
symai/backend/mixin/cerebras.py,sha256=MEc9vQ6G4KWWrt0NFjdt2y0rojhtBidwa_n4M8Z5EKI,215
|
|
71
71
|
symai/backend/mixin/deepseek.py,sha256=7TnyqXQb2t6r6-hzOClPzxfO2d7TShYC989Lmn_YTzM,414
|
|
72
72
|
symai/backend/mixin/google.py,sha256=N1xxrrTcQkcKJtdPbRorev6dfJ1F65I5XavrGR06GN4,494
|
|
@@ -143,9 +143,9 @@ symai/server/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
|
143
143
|
symai/server/huggingface_server.py,sha256=wSAVqFiKQsCu5UB2YYVpxJBhJ7GgQBBfePxNi265yP8,9039
|
|
144
144
|
symai/server/llama_cpp_server.py,sha256=-WPTNB2cbnwtnpES4AtPM__MCasDKl83jr94JGS9tmI,2144
|
|
145
145
|
symai/server/qdrant_server.py,sha256=l4r4rz29c7cO1dapXO0LQ4sHW4WF44keuz7j8v5azMc,9854
|
|
146
|
-
symbolicai-1.7.
|
|
147
|
-
symbolicai-1.7.
|
|
148
|
-
symbolicai-1.7.
|
|
149
|
-
symbolicai-1.7.
|
|
150
|
-
symbolicai-1.7.
|
|
151
|
-
symbolicai-1.7.
|
|
146
|
+
symbolicai-1.7.1.dist-info/licenses/LICENSE,sha256=9vRFudlJ1ghVfra5lcCUIYQCqnZSYcBLjLHbGRsrQCs,1505
|
|
147
|
+
symbolicai-1.7.1.dist-info/METADATA,sha256=PmkaRcYWBMfhFKQcP3xe2Zg2Hsaqbr2zd7lJPxiTp_E,22946
|
|
148
|
+
symbolicai-1.7.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
149
|
+
symbolicai-1.7.1.dist-info/entry_points.txt,sha256=JV5sdydIfUZdDF6QBEQHiZHod6XNPjCjpWQrXh7gTAw,261
|
|
150
|
+
symbolicai-1.7.1.dist-info/top_level.txt,sha256=bOoIDfpDIvCQtQgXcwVKJvxAKwsxpxo2IL4z92rNJjw,6
|
|
151
|
+
symbolicai-1.7.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|