inferencesh 0.1.19__tar.gz → 0.1.23__tar.gz
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.
Potentially problematic release.
This version of inferencesh might be problematic. Click here for more details.
- {inferencesh-0.1.19/src/inferencesh.egg-info → inferencesh-0.1.23}/PKG-INFO +3 -2
- {inferencesh-0.1.19 → inferencesh-0.1.23}/pyproject.toml +1 -1
- inferencesh-0.1.23/src/inferencesh/__init__.py +5 -0
- {inferencesh-0.1.19 → inferencesh-0.1.23}/src/inferencesh/sdk.py +69 -2
- {inferencesh-0.1.19 → inferencesh-0.1.23/src/inferencesh.egg-info}/PKG-INFO +3 -2
- inferencesh-0.1.19/src/inferencesh/__init__.py +0 -5
- {inferencesh-0.1.19 → inferencesh-0.1.23}/LICENSE +0 -0
- {inferencesh-0.1.19 → inferencesh-0.1.23}/README.md +0 -0
- {inferencesh-0.1.19 → inferencesh-0.1.23}/setup.cfg +0 -0
- {inferencesh-0.1.19 → inferencesh-0.1.23}/setup.py +0 -0
- {inferencesh-0.1.19 → inferencesh-0.1.23}/src/inferencesh.egg-info/SOURCES.txt +0 -0
- {inferencesh-0.1.19 → inferencesh-0.1.23}/src/inferencesh.egg-info/dependency_links.txt +0 -0
- {inferencesh-0.1.19 → inferencesh-0.1.23}/src/inferencesh.egg-info/entry_points.txt +0 -0
- {inferencesh-0.1.19 → inferencesh-0.1.23}/src/inferencesh.egg-info/requires.txt +0 -0
- {inferencesh-0.1.19 → inferencesh-0.1.23}/src/inferencesh.egg-info/top_level.txt +0 -0
- {inferencesh-0.1.19 → inferencesh-0.1.23}/tests/test_sdk.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: inferencesh
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.23
|
|
4
4
|
Summary: inference.sh Python SDK
|
|
5
5
|
Author: Inference Shell Inc.
|
|
6
6
|
Author-email: "Inference Shell Inc." <hello@inference.sh>
|
|
@@ -14,6 +14,7 @@ Description-Content-Type: text/markdown
|
|
|
14
14
|
License-File: LICENSE
|
|
15
15
|
Requires-Dist: pydantic>=2.0.0
|
|
16
16
|
Dynamic: author
|
|
17
|
+
Dynamic: license-file
|
|
17
18
|
Dynamic: requires-python
|
|
18
19
|
|
|
19
20
|
# inference.sh CLI
|
|
@@ -5,8 +5,9 @@ import os
|
|
|
5
5
|
import urllib.request
|
|
6
6
|
import urllib.parse
|
|
7
7
|
import tempfile
|
|
8
|
-
|
|
8
|
+
from pydantic import Field
|
|
9
9
|
from typing import Any, Dict, List
|
|
10
|
+
|
|
10
11
|
import inspect
|
|
11
12
|
import ast
|
|
12
13
|
import textwrap
|
|
@@ -214,4 +215,70 @@ class File(BaseModel):
|
|
|
214
215
|
|
|
215
216
|
def refresh_metadata(self) -> None:
|
|
216
217
|
"""Refresh all metadata from the file."""
|
|
217
|
-
self._populate_metadata()
|
|
218
|
+
self._populate_metadata()
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
class ContextMessage(BaseModel):
|
|
222
|
+
role: str = Field(
|
|
223
|
+
description="The role of the message",
|
|
224
|
+
enum=["user", "assistant", "system"]
|
|
225
|
+
)
|
|
226
|
+
text: str = Field(
|
|
227
|
+
description="The text content of the message"
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
class ContextMessageWithImage(ContextMessage):
|
|
231
|
+
image: Optional[File] = Field(
|
|
232
|
+
description="The image url of the message",
|
|
233
|
+
default=None
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
class LLMInput(BaseAppInput):
|
|
237
|
+
system_prompt: str = Field(
|
|
238
|
+
description="The system prompt to use for the model",
|
|
239
|
+
default="You are a helpful assistant that can answer questions and help with tasks.",
|
|
240
|
+
examples=[
|
|
241
|
+
"You are a helpful assistant that can answer questions and help with tasks.",
|
|
242
|
+
"You are a certified medical professional who can provide accurate health information.",
|
|
243
|
+
"You are a certified financial advisor who can give sound investment guidance.",
|
|
244
|
+
"You are a certified cybersecurity expert who can explain security best practices.",
|
|
245
|
+
"You are a certified environmental scientist who can discuss climate and sustainability.",
|
|
246
|
+
]
|
|
247
|
+
)
|
|
248
|
+
context: list[ContextMessage] = Field(
|
|
249
|
+
description="The context to use for the model",
|
|
250
|
+
examples=[
|
|
251
|
+
[
|
|
252
|
+
{"role": "user", "content": [{"type": "text", "text": "What is the capital of France?"}]},
|
|
253
|
+
{"role": "assistant", "content": [{"type": "text", "text": "The capital of France is Paris."}]}
|
|
254
|
+
],
|
|
255
|
+
[
|
|
256
|
+
{"role": "user", "content": [{"type": "text", "text": "What is the weather like today?"}]},
|
|
257
|
+
{"role": "assistant", "content": [{"type": "text", "text": "I apologize, but I don't have access to real-time weather information. You would need to check a weather service or app to get current weather conditions for your location."}]}
|
|
258
|
+
],
|
|
259
|
+
[
|
|
260
|
+
{"role": "user", "content": [{"type": "text", "text": "Can you help me write a poem about spring?"}]},
|
|
261
|
+
{"role": "assistant", "content": [{"type": "text", "text": "Here's a short poem about spring:\n\nGreen buds awakening,\nSoft rain gently falling down,\nNew life springs anew.\n\nWarm sun breaks through clouds,\nBirds return with joyful song,\nNature's sweet rebirth."}]}
|
|
262
|
+
],
|
|
263
|
+
[
|
|
264
|
+
{"role": "user", "content": [{"type": "text", "text": "Explain quantum computing in simple terms"}]},
|
|
265
|
+
{"role": "assistant", "content": [{"type": "text", "text": "Quantum computing is like having a super-powerful calculator that can solve many problems at once instead of one at a time. While regular computers use bits (0s and 1s), quantum computers use quantum bits or \"qubits\" that can be both 0 and 1 at the same time - kind of like being in two places at once! This allows them to process huge amounts of information much faster than regular computers for certain types of problems."}]}
|
|
266
|
+
]
|
|
267
|
+
],
|
|
268
|
+
default=[]
|
|
269
|
+
)
|
|
270
|
+
text: str = Field(
|
|
271
|
+
description="The user prompt to use for the model",
|
|
272
|
+
examples=[
|
|
273
|
+
"What is the capital of France?",
|
|
274
|
+
"What is the weather like today?",
|
|
275
|
+
"Can you help me write a poem about spring?",
|
|
276
|
+
"Explain quantum computing in simple terms"
|
|
277
|
+
],
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
class LLMInputWithImage(LLMInput):
|
|
281
|
+
image: Optional[File] = Field(
|
|
282
|
+
description="The image to use for the model",
|
|
283
|
+
default=None
|
|
284
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: inferencesh
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.23
|
|
4
4
|
Summary: inference.sh Python SDK
|
|
5
5
|
Author: Inference Shell Inc.
|
|
6
6
|
Author-email: "Inference Shell Inc." <hello@inference.sh>
|
|
@@ -14,6 +14,7 @@ Description-Content-Type: text/markdown
|
|
|
14
14
|
License-File: LICENSE
|
|
15
15
|
Requires-Dist: pydantic>=2.0.0
|
|
16
16
|
Dynamic: author
|
|
17
|
+
Dynamic: license-file
|
|
17
18
|
Dynamic: requires-python
|
|
18
19
|
|
|
19
20
|
# inference.sh CLI
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|