prompture 0.0.37.dev3__py3-none-any.whl → 0.0.38.dev1__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.
- prompture/_version.py +2 -2
- prompture/drivers/async_lmstudio_driver.py +16 -3
- prompture/drivers/async_ollama_driver.py +6 -3
- prompture/drivers/lmstudio_driver.py +16 -3
- prompture/drivers/ollama_driver.py +9 -5
- {prompture-0.0.37.dev3.dist-info → prompture-0.0.38.dev1.dist-info}/METADATA +1 -1
- {prompture-0.0.37.dev3.dist-info → prompture-0.0.38.dev1.dist-info}/RECORD +11 -11
- {prompture-0.0.37.dev3.dist-info → prompture-0.0.38.dev1.dist-info}/WHEEL +0 -0
- {prompture-0.0.37.dev3.dist-info → prompture-0.0.38.dev1.dist-info}/entry_points.txt +0 -0
- {prompture-0.0.37.dev3.dist-info → prompture-0.0.38.dev1.dist-info}/licenses/LICENSE +0 -0
- {prompture-0.0.37.dev3.dist-info → prompture-0.0.38.dev1.dist-info}/top_level.txt +0 -0
prompture/_version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.0.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 0,
|
|
31
|
+
__version__ = version = '0.0.38.dev1'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 0, 38, 'dev1')
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -15,6 +15,7 @@ logger = logging.getLogger(__name__)
|
|
|
15
15
|
|
|
16
16
|
class AsyncLMStudioDriver(AsyncDriver):
|
|
17
17
|
supports_json_mode = True
|
|
18
|
+
supports_json_schema = True
|
|
18
19
|
supports_vision = True
|
|
19
20
|
|
|
20
21
|
MODEL_PRICING = {"default": {"prompt": 0.0, "completion": 0.0}}
|
|
@@ -70,9 +71,21 @@ class AsyncLMStudioDriver(AsyncDriver):
|
|
|
70
71
|
"temperature": merged_options.get("temperature", 0.7),
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
# Native JSON mode support
|
|
74
|
+
# Native JSON mode support (LM Studio requires json_schema, not json_object)
|
|
74
75
|
if merged_options.get("json_mode"):
|
|
75
|
-
|
|
76
|
+
json_schema = merged_options.get("json_schema")
|
|
77
|
+
if json_schema:
|
|
78
|
+
payload["response_format"] = {
|
|
79
|
+
"type": "json_schema",
|
|
80
|
+
"json_schema": {
|
|
81
|
+
"name": "extraction",
|
|
82
|
+
"schema": json_schema,
|
|
83
|
+
},
|
|
84
|
+
}
|
|
85
|
+
else:
|
|
86
|
+
# No schema provided — omit response_format entirely;
|
|
87
|
+
# LM Studio rejects "json_object" type.
|
|
88
|
+
pass
|
|
76
89
|
|
|
77
90
|
async with httpx.AsyncClient() as client:
|
|
78
91
|
try:
|
|
@@ -128,7 +141,7 @@ class AsyncLMStudioDriver(AsyncDriver):
|
|
|
128
141
|
async def unload_model(self, model: str) -> dict[str, Any]:
|
|
129
142
|
"""Unload a model from LM Studio via POST /api/v1/models/unload."""
|
|
130
143
|
url = f"{self.base_url}/api/v1/models/unload"
|
|
131
|
-
payload = {"
|
|
144
|
+
payload = {"instance_id": model}
|
|
132
145
|
async with httpx.AsyncClient() as client:
|
|
133
146
|
r = await client.post(url, json=payload, headers=self._headers, timeout=30)
|
|
134
147
|
r.raise_for_status()
|
|
@@ -15,6 +15,7 @@ logger = logging.getLogger(__name__)
|
|
|
15
15
|
|
|
16
16
|
class AsyncOllamaDriver(AsyncDriver):
|
|
17
17
|
supports_json_mode = True
|
|
18
|
+
supports_json_schema = True
|
|
18
19
|
supports_vision = True
|
|
19
20
|
|
|
20
21
|
MODEL_PRICING = {"default": {"prompt": 0.0, "completion": 0.0}}
|
|
@@ -42,9 +43,10 @@ class AsyncOllamaDriver(AsyncDriver):
|
|
|
42
43
|
"stream": False,
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
# Native JSON mode support
|
|
46
|
+
# Native JSON mode / structured output support
|
|
46
47
|
if merged_options.get("json_mode"):
|
|
47
|
-
|
|
48
|
+
json_schema = merged_options.get("json_schema")
|
|
49
|
+
payload["format"] = json_schema if json_schema else "json"
|
|
48
50
|
|
|
49
51
|
if "temperature" in merged_options:
|
|
50
52
|
payload["temperature"] = merged_options["temperature"]
|
|
@@ -95,7 +97,8 @@ class AsyncOllamaDriver(AsyncDriver):
|
|
|
95
97
|
}
|
|
96
98
|
|
|
97
99
|
if merged_options.get("json_mode"):
|
|
98
|
-
|
|
100
|
+
json_schema = merged_options.get("json_schema")
|
|
101
|
+
payload["format"] = json_schema if json_schema else "json"
|
|
99
102
|
|
|
100
103
|
if "temperature" in merged_options:
|
|
101
104
|
payload["temperature"] = merged_options["temperature"]
|
|
@@ -12,6 +12,7 @@ logger = logging.getLogger(__name__)
|
|
|
12
12
|
|
|
13
13
|
class LMStudioDriver(Driver):
|
|
14
14
|
supports_json_mode = True
|
|
15
|
+
supports_json_schema = True
|
|
15
16
|
supports_vision = True
|
|
16
17
|
|
|
17
18
|
# LM Studio is local – costs are always zero.
|
|
@@ -82,9 +83,21 @@ class LMStudioDriver(Driver):
|
|
|
82
83
|
"temperature": merged_options.get("temperature", 0.7),
|
|
83
84
|
}
|
|
84
85
|
|
|
85
|
-
# Native JSON mode support
|
|
86
|
+
# Native JSON mode support (LM Studio requires json_schema, not json_object)
|
|
86
87
|
if merged_options.get("json_mode"):
|
|
87
|
-
|
|
88
|
+
json_schema = merged_options.get("json_schema")
|
|
89
|
+
if json_schema:
|
|
90
|
+
payload["response_format"] = {
|
|
91
|
+
"type": "json_schema",
|
|
92
|
+
"json_schema": {
|
|
93
|
+
"name": "extraction",
|
|
94
|
+
"schema": json_schema,
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
else:
|
|
98
|
+
# No schema provided — omit response_format entirely;
|
|
99
|
+
# LM Studio rejects "json_object" type.
|
|
100
|
+
pass
|
|
88
101
|
|
|
89
102
|
try:
|
|
90
103
|
logger.debug(f"Sending request to LM Studio endpoint: {self.endpoint}")
|
|
@@ -152,7 +165,7 @@ class LMStudioDriver(Driver):
|
|
|
152
165
|
def unload_model(self, model: str) -> dict[str, Any]:
|
|
153
166
|
"""Unload a model from LM Studio via POST /api/v1/models/unload."""
|
|
154
167
|
url = f"{self.base_url}/api/v1/models/unload"
|
|
155
|
-
payload = {"
|
|
168
|
+
payload = {"instance_id": model}
|
|
156
169
|
r = requests.post(url, json=payload, headers=self._headers, timeout=30)
|
|
157
170
|
r.raise_for_status()
|
|
158
171
|
return r.json()
|
|
@@ -13,6 +13,7 @@ logger = logging.getLogger(__name__)
|
|
|
13
13
|
|
|
14
14
|
class OllamaDriver(Driver):
|
|
15
15
|
supports_json_mode = True
|
|
16
|
+
supports_json_schema = True
|
|
16
17
|
supports_streaming = True
|
|
17
18
|
supports_vision = True
|
|
18
19
|
|
|
@@ -64,9 +65,10 @@ class OllamaDriver(Driver):
|
|
|
64
65
|
"stream": False,
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
# Native JSON mode support
|
|
68
|
+
# Native JSON mode / structured output support
|
|
68
69
|
if merged_options.get("json_mode"):
|
|
69
|
-
|
|
70
|
+
json_schema = merged_options.get("json_schema")
|
|
71
|
+
payload["format"] = json_schema if json_schema else "json"
|
|
70
72
|
|
|
71
73
|
# Add any Ollama-specific options from merged_options
|
|
72
74
|
if "temperature" in merged_options:
|
|
@@ -152,7 +154,8 @@ class OllamaDriver(Driver):
|
|
|
152
154
|
}
|
|
153
155
|
|
|
154
156
|
if merged_options.get("json_mode"):
|
|
155
|
-
|
|
157
|
+
json_schema = merged_options.get("json_schema")
|
|
158
|
+
payload["format"] = json_schema if json_schema else "json"
|
|
156
159
|
if "temperature" in merged_options:
|
|
157
160
|
payload["temperature"] = merged_options["temperature"]
|
|
158
161
|
if "top_p" in merged_options:
|
|
@@ -210,9 +213,10 @@ class OllamaDriver(Driver):
|
|
|
210
213
|
"stream": False,
|
|
211
214
|
}
|
|
212
215
|
|
|
213
|
-
# Native JSON mode support
|
|
216
|
+
# Native JSON mode / structured output support
|
|
214
217
|
if merged_options.get("json_mode"):
|
|
215
|
-
|
|
218
|
+
json_schema = merged_options.get("json_schema")
|
|
219
|
+
payload["format"] = json_schema if json_schema else "json"
|
|
216
220
|
|
|
217
221
|
if "temperature" in merged_options:
|
|
218
222
|
payload["temperature"] = merged_options["temperature"]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
prompture/__init__.py,sha256=RrpHZlLPpzntUOp2tL2II2DdVxQRoCxY6JBF_b4k3s0,7213
|
|
2
|
-
prompture/_version.py,sha256=
|
|
2
|
+
prompture/_version.py,sha256=RC6_NeerdSjHaWAxl4iygvpfefFayk2zxKyKmOU7s08,719
|
|
3
3
|
prompture/agent.py,sha256=xe_yFHGDzTxaU4tmaLt5AQnzrN0I72hBGwGVrCxg2D0,34704
|
|
4
4
|
prompture/agent_types.py,sha256=Icl16PQI-ThGLMFCU43adtQA6cqETbsPn4KssKBI4xc,4664
|
|
5
5
|
prompture/async_agent.py,sha256=nOLOQCNkg0sKKTpryIiidmIcAAlA3FR2NfnZwrNBuCg,33066
|
|
@@ -41,9 +41,9 @@ prompture/drivers/async_google_driver.py,sha256=UL3WtQ2gdVYXPpq_HqzNkOifYiR7GLAD
|
|
|
41
41
|
prompture/drivers/async_grok_driver.py,sha256=bblcUY5c5NJ_IeuFQ-jHRapGi_WywVgH6SSWWWbUMzo,3546
|
|
42
42
|
prompture/drivers/async_groq_driver.py,sha256=gHvVe4M5VaRcyvonK9FQMLmCuL7i7HV9hwWcRgASUSg,3075
|
|
43
43
|
prompture/drivers/async_hugging_driver.py,sha256=IblxqU6TpNUiigZ0BCgNkAgzpUr2FtPHJOZnOZMnHF0,2152
|
|
44
|
-
prompture/drivers/async_lmstudio_driver.py,sha256=
|
|
44
|
+
prompture/drivers/async_lmstudio_driver.py,sha256=rPn2qVPm6UE2APzAn7ZHYTELUwr0dQMi8XHv6gAhyH8,5782
|
|
45
45
|
prompture/drivers/async_local_http_driver.py,sha256=qoigIf-w3_c2dbVdM6m1e2RMAWP4Gk4VzVs5hM3lPvQ,1609
|
|
46
|
-
prompture/drivers/async_ollama_driver.py,sha256=
|
|
46
|
+
prompture/drivers/async_ollama_driver.py,sha256=FaSXtFXrgeVHIe0b90Vg6rGeSTWLpPnjaThh9Ai7qQo,5042
|
|
47
47
|
prompture/drivers/async_openai_driver.py,sha256=eLdVYQ8BUErQzVr4Ek1BZ75riMbHMz3ZPm6VQSTNFxk,3572
|
|
48
48
|
prompture/drivers/async_openrouter_driver.py,sha256=VcSYOeBhbzRbzorYh_7K58yWCXB4UO0d6MmpBLf-7lQ,3783
|
|
49
49
|
prompture/drivers/async_registry.py,sha256=syervbb7THneJ-NUVSuxy4cnxGW6VuNzKv-Aqqn2ysU,4329
|
|
@@ -53,9 +53,9 @@ prompture/drivers/google_driver.py,sha256=2V2mfWO8TuJTtvOKBW11WM1dicNfYFhBJrt7Ss
|
|
|
53
53
|
prompture/drivers/grok_driver.py,sha256=AIwuzNAQyOhmVDA07ISWt2e-rsv5aYk3I5AM4HkLM7o,5294
|
|
54
54
|
prompture/drivers/groq_driver.py,sha256=9cZI21RsgYJTjnrtX2fVA0AadDL-VklhY4ugjDCutwM,4195
|
|
55
55
|
prompture/drivers/hugging_driver.py,sha256=gZir3XnM77VfYIdnu3S1pRftlZJM6G3L8bgGn5esg-Q,2346
|
|
56
|
-
prompture/drivers/lmstudio_driver.py,sha256=
|
|
56
|
+
prompture/drivers/lmstudio_driver.py,sha256=9ZnJ1l5LuWAjkH2WKfFjZprNMVIXoSC7qXDNDTxm-tA,6748
|
|
57
57
|
prompture/drivers/local_http_driver.py,sha256=QJgEf9kAmy8YZ5fb8FHnWuhoDoZYNd8at4jegzNVJH0,1658
|
|
58
|
-
prompture/drivers/ollama_driver.py,sha256=
|
|
58
|
+
prompture/drivers/ollama_driver.py,sha256=k9xeUwFp91OrDbjkbYI-F8CDFy5ew-zQ0btXqwbXXWM,10220
|
|
59
59
|
prompture/drivers/openai_driver.py,sha256=BykJ3Z16BaWREVnAGaTYFwK2ZCI2aGOjo2YdsR8m_6w,10164
|
|
60
60
|
prompture/drivers/openrouter_driver.py,sha256=OAVmvCQ1ZW1ApJHsXJa8i1Dst9EUsZAt6uEDqF9aIQw,5408
|
|
61
61
|
prompture/drivers/registry.py,sha256=Dg_5w9alnIPKhOnsR9Xspuf5T7roBGu0r_L2Cf-UhXs,9926
|
|
@@ -69,9 +69,9 @@ prompture/scaffold/templates/env.example.j2,sha256=eESKr1KWgyrczO6d-nwAhQwSpf_G-
|
|
|
69
69
|
prompture/scaffold/templates/main.py.j2,sha256=TEgc5OvsZOEX0JthkSW1NI_yLwgoeVN_x97Ibg-vyWY,2632
|
|
70
70
|
prompture/scaffold/templates/models.py.j2,sha256=JrZ99GCVK6TKWapskVRSwCssGrTu5cGZ_r46fOhY2GE,858
|
|
71
71
|
prompture/scaffold/templates/requirements.txt.j2,sha256=m3S5fi1hq9KG9l_9j317rjwWww0a43WMKd8VnUWv2A4,102
|
|
72
|
-
prompture-0.0.
|
|
73
|
-
prompture-0.0.
|
|
74
|
-
prompture-0.0.
|
|
75
|
-
prompture-0.0.
|
|
76
|
-
prompture-0.0.
|
|
77
|
-
prompture-0.0.
|
|
72
|
+
prompture-0.0.38.dev1.dist-info/licenses/LICENSE,sha256=0HgDepH7aaHNFhHF-iXuW6_GqDfYPnVkjtiCAZ4yS8I,1060
|
|
73
|
+
prompture-0.0.38.dev1.dist-info/METADATA,sha256=ZDa9mNU6SdEy4IKb7l-wVvR2Tp_bO3RZ8sHshWtq6Y8,10842
|
|
74
|
+
prompture-0.0.38.dev1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
75
|
+
prompture-0.0.38.dev1.dist-info/entry_points.txt,sha256=AFPG3lJR86g4IJMoWQUW5Ph7G6MLNWG3A2u2Tp9zkp8,48
|
|
76
|
+
prompture-0.0.38.dev1.dist-info/top_level.txt,sha256=to86zq_kjfdoLeAxQNr420UWqT0WzkKoZ509J7Qr2t4,10
|
|
77
|
+
prompture-0.0.38.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|