symbolicai 0.18.0__py3-none-any.whl → 0.18.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_groq.py +11 -3
- symai/utils.py +2 -1
- {symbolicai-0.18.0.dist-info → symbolicai-0.18.1.dist-info}/METADATA +1 -1
- {symbolicai-0.18.0.dist-info → symbolicai-0.18.1.dist-info}/RECORD +8 -8
- {symbolicai-0.18.0.dist-info → symbolicai-0.18.1.dist-info}/WHEEL +0 -0
- {symbolicai-0.18.0.dist-info → symbolicai-0.18.1.dist-info}/entry_points.txt +0 -0
- {symbolicai-0.18.0.dist-info → symbolicai-0.18.1.dist-info}/top_level.txt +0 -0
symai/__init__.py
CHANGED
|
@@ -239,6 +239,14 @@ class GroqEngine(Engine):
|
|
|
239
239
|
CustomUserWarning("If N is supplied, it must be equal to 1. We default to 1 to not crash your program.")
|
|
240
240
|
n = 1
|
|
241
241
|
|
|
242
|
+
# Handle Groq JSON-mode quirk: JSON Object Mode internally uses a constrainer tool.
|
|
243
|
+
response_format = kwargs.get('response_format')
|
|
244
|
+
tool_choice = kwargs.get('tool_choice', 'auto' if kwargs.get('tools') else 'none')
|
|
245
|
+
tools = kwargs.get('tools')
|
|
246
|
+
if response_format and isinstance(response_format, dict) and response_format.get('type') == 'json_object':
|
|
247
|
+
if tool_choice in (None, 'none'): tool_choice = 'auto'
|
|
248
|
+
if tools: tools = None
|
|
249
|
+
|
|
242
250
|
payload = {
|
|
243
251
|
"messages": messages,
|
|
244
252
|
"model": self._handle_prefix(kwargs.get('model', self.model)),
|
|
@@ -252,9 +260,9 @@ class GroqEngine(Engine):
|
|
|
252
260
|
"service_tier": kwargs.get('service_tier', 'on_demand'),
|
|
253
261
|
"top_p": kwargs.get('top_p', 1),
|
|
254
262
|
"n": n,
|
|
255
|
-
"tools":
|
|
256
|
-
"tool_choice":
|
|
257
|
-
"response_format":
|
|
263
|
+
"tools": tools,
|
|
264
|
+
"tool_choice": tool_choice,
|
|
265
|
+
"response_format": response_format,
|
|
258
266
|
}
|
|
259
267
|
|
|
260
268
|
if not self._handle_prefix(self.model).startswith('qwen'):
|
symai/utils.py
CHANGED
|
@@ -143,7 +143,8 @@ class CustomUserWarning:
|
|
|
143
143
|
filename = caller.filename
|
|
144
144
|
filename = filename[filename.find('symbolicai'):]
|
|
145
145
|
with ConsoleStyle('warn') as console:
|
|
146
|
-
|
|
146
|
+
# Escape content to avoid HTML parsing errors from model text like <|constrain|>JSON
|
|
147
|
+
console.print(f"{filename}:{lineno}: {UserWarning.__name__}: {message}", escape=True)
|
|
147
148
|
# Always raise the warning if raise_with is provided
|
|
148
149
|
if raise_with is not None:
|
|
149
150
|
raise raise_with(message)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: symbolicai
|
|
3
|
-
Version: 0.18.
|
|
3
|
+
Version: 0.18.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
|
Project-URL: Homepage, https://extensity.ai
|
|
@@ -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=31jZIF-1_Z1uxIlCN4pDrkjtBY2nZprH6mh2dmhnDTQ,16464
|
|
3
3
|
symai/chat.py,sha256=vqEe7NqSWdzr9ixkko_094SR1LIbgPLcZxQ8W7782N4,12775
|
|
4
4
|
symai/components.py,sha256=YazuyQasU7P3dvUHn-h5A54D-lf6wD_Hqc8Y6Gnd11g,51440
|
|
5
5
|
symai/constraints.py,sha256=S1ywLB8nFQy4-beDoJz6IvLTiZHGR8Fu5RNTY4v5zG0,1641
|
|
@@ -19,7 +19,7 @@ symai/shellsv.py,sha256=Y552dkQrKrnMhwDyK9wJSA1bnJF_bh60iMBom-eAbsM,37277
|
|
|
19
19
|
symai/strategy.py,sha256=D2DD5mTgp2aDzIXNdKU1FwoSdnIWcKYL2Yv7Tue-Sy8,37885
|
|
20
20
|
symai/symbol.py,sha256=unRyZj_2KepkV6xTLYLWzYUkBZh2J5UB-OHyPhFn7uE,40637
|
|
21
21
|
symai/symsh.md,sha256=QwY_-fX0Ge7Aazul0xde2DuF2FZLw_elxrkXR3kuKDQ,1245
|
|
22
|
-
symai/utils.py,sha256=
|
|
22
|
+
symai/utils.py,sha256=yg0ke19xEPqJSnkvMP9JXxNxKmBJuTJo_j1SWXTi-nQ,9927
|
|
23
23
|
symai/backend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
24
|
symai/backend/base.py,sha256=7zXaZtByUXfOqxqEvbdmB_E0GYvvpwfj3FPsf3EZP0Y,7523
|
|
25
25
|
symai/backend/settings.py,sha256=YCt0AJgWM2egRg3hLz4S1vEypVHm654oXxgzNvLSLj8,3213
|
|
@@ -47,7 +47,7 @@ symai/backend/engines/neurosymbolic/engine_anthropic_claudeX_chat.py,sha256=01Bd
|
|
|
47
47
|
symai/backend/engines/neurosymbolic/engine_anthropic_claudeX_reasoning.py,sha256=ZPSksJjm3dnJBZKFDFp9HJpD5Nd2F2HxIwoZzo1Ders,19772
|
|
48
48
|
symai/backend/engines/neurosymbolic/engine_deepseekX_reasoning.py,sha256=ZaZvAVpgv5GYjE2yZmYhP5zUnEKak5I1mndRfiGfr6U,8995
|
|
49
49
|
symai/backend/engines/neurosymbolic/engine_google_geminiX_reasoning.py,sha256=kxGWYsxnQkpsm40HB1MUGggWmrWz8avCY3jvNrohaKw,25622
|
|
50
|
-
symai/backend/engines/neurosymbolic/engine_groq.py,sha256=
|
|
50
|
+
symai/backend/engines/neurosymbolic/engine_groq.py,sha256=r-UqWuvQ2ZdknruzFB4XfPQluvmuMCpwEAf6JAzxQuw,12156
|
|
51
51
|
symai/backend/engines/neurosymbolic/engine_huggingface.py,sha256=XIu9BnQo-J2flXFCCKwCJJmVozU9WDNkPndmpi-DlzE,7920
|
|
52
52
|
symai/backend/engines/neurosymbolic/engine_llama_cpp.py,sha256=ZbHaRYOb7QSD0OrFURp4PT0KJgQk3gdJMD_Itxn7QcU,11323
|
|
53
53
|
symai/backend/engines/neurosymbolic/engine_openai_gptX_chat.py,sha256=Y-auxUFC4W9dfRzzgI3_rbWbPiOx4xfvKS4sM0KxP40,25250
|
|
@@ -153,8 +153,8 @@ symai/ops/primitives.py,sha256=EaB2Ekx9yGNDaQa3aKS5KpuEr5awAUbO3OcBbufI-l4,11072
|
|
|
153
153
|
symai/server/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
154
154
|
symai/server/huggingface_server.py,sha256=UpSBflnQaenDjY1AAn5LUYeg5J4gJLWiMuC5DcoIV3E,8743
|
|
155
155
|
symai/server/llama_cpp_server.py,sha256=qVCldTdcQhK2YCu7sDNSYziu1p2AQieqMFfY028-yOc,2049
|
|
156
|
-
symbolicai-0.18.
|
|
157
|
-
symbolicai-0.18.
|
|
158
|
-
symbolicai-0.18.
|
|
159
|
-
symbolicai-0.18.
|
|
160
|
-
symbolicai-0.18.
|
|
156
|
+
symbolicai-0.18.1.dist-info/METADATA,sha256=rvGijh0cqvWjyrex7K0tBVhgb_h6Ul1xRLDOl7oy-fM,21327
|
|
157
|
+
symbolicai-0.18.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
158
|
+
symbolicai-0.18.1.dist-info/entry_points.txt,sha256=JV5sdydIfUZdDF6QBEQHiZHod6XNPjCjpWQrXh7gTAw,261
|
|
159
|
+
symbolicai-0.18.1.dist-info/top_level.txt,sha256=bOoIDfpDIvCQtQgXcwVKJvxAKwsxpxo2IL4z92rNJjw,6
|
|
160
|
+
symbolicai-0.18.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|