inferencesh 0.1.16__tar.gz → 0.1.17__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.16/src/inferencesh.egg-info → inferencesh-0.1.17}/PKG-INFO +3 -3
- {inferencesh-0.1.16 → inferencesh-0.1.17}/README.md +2 -2
- {inferencesh-0.1.16 → inferencesh-0.1.17}/pyproject.toml +1 -1
- {inferencesh-0.1.16 → inferencesh-0.1.17}/src/inferencesh/sdk.py +4 -4
- {inferencesh-0.1.16 → inferencesh-0.1.17/src/inferencesh.egg-info}/PKG-INFO +3 -3
- {inferencesh-0.1.16 → inferencesh-0.1.17}/tests/test_sdk.py +1 -1
- {inferencesh-0.1.16 → inferencesh-0.1.17}/LICENSE +0 -0
- {inferencesh-0.1.16 → inferencesh-0.1.17}/setup.cfg +0 -0
- {inferencesh-0.1.16 → inferencesh-0.1.17}/setup.py +0 -0
- {inferencesh-0.1.16 → inferencesh-0.1.17}/src/inferencesh/__init__.py +0 -0
- {inferencesh-0.1.16 → inferencesh-0.1.17}/src/inferencesh.egg-info/SOURCES.txt +0 -0
- {inferencesh-0.1.16 → inferencesh-0.1.17}/src/inferencesh.egg-info/dependency_links.txt +0 -0
- {inferencesh-0.1.16 → inferencesh-0.1.17}/src/inferencesh.egg-info/entry_points.txt +0 -0
- {inferencesh-0.1.16 → inferencesh-0.1.17}/src/inferencesh.egg-info/requires.txt +0 -0
- {inferencesh-0.1.16 → inferencesh-0.1.17}/src/inferencesh.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: inferencesh
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.17
|
|
4
4
|
Summary: inference.sh Python SDK
|
|
5
5
|
Author: Inference Shell Inc.
|
|
6
6
|
Author-email: "Inference Shell Inc." <hello@inference.sh>
|
|
@@ -39,7 +39,7 @@ file = File(path="/path/to/file.png")
|
|
|
39
39
|
# File with explicit metadata
|
|
40
40
|
file = File(
|
|
41
41
|
path="/path/to/file.png",
|
|
42
|
-
|
|
42
|
+
content_type="image/png",
|
|
43
43
|
filename="custom_name.png",
|
|
44
44
|
size=1024 # in bytes
|
|
45
45
|
)
|
|
@@ -51,7 +51,7 @@ file = File.from_path("/path/to/file.png")
|
|
|
51
51
|
exists = file.exists()
|
|
52
52
|
|
|
53
53
|
# Access file metadata
|
|
54
|
-
print(file.
|
|
54
|
+
print(file.content_type) # automatically detected if not specified
|
|
55
55
|
print(file.size) # file size in bytes
|
|
56
56
|
print(file.filename) # basename of the file
|
|
57
57
|
|
|
@@ -21,7 +21,7 @@ file = File(path="/path/to/file.png")
|
|
|
21
21
|
# File with explicit metadata
|
|
22
22
|
file = File(
|
|
23
23
|
path="/path/to/file.png",
|
|
24
|
-
|
|
24
|
+
content_type="image/png",
|
|
25
25
|
filename="custom_name.png",
|
|
26
26
|
size=1024 # in bytes
|
|
27
27
|
)
|
|
@@ -33,7 +33,7 @@ file = File.from_path("/path/to/file.png")
|
|
|
33
33
|
exists = file.exists()
|
|
34
34
|
|
|
35
35
|
# Access file metadata
|
|
36
|
-
print(file.
|
|
36
|
+
print(file.content_type) # automatically detected if not specified
|
|
37
37
|
print(file.size) # file size in bytes
|
|
38
38
|
print(file.filename) # basename of the file
|
|
39
39
|
|
|
@@ -103,7 +103,7 @@ class File(BaseModel):
|
|
|
103
103
|
"""A class representing a file in the inference.sh ecosystem."""
|
|
104
104
|
uri: str # Original location (URL or file path)
|
|
105
105
|
path: Optional[str] = None # Resolved local file path
|
|
106
|
-
|
|
106
|
+
content_type: Optional[str] = None # MIME type of the file
|
|
107
107
|
size: Optional[int] = None # File size in bytes
|
|
108
108
|
filename: Optional[str] = None # Original filename if available
|
|
109
109
|
_tmp_path: Optional[str] = PrivateAttr(default=None) # Internal storage for temporary file path
|
|
@@ -177,8 +177,8 @@ class File(BaseModel):
|
|
|
177
177
|
def _populate_metadata(self) -> None:
|
|
178
178
|
"""Populate file metadata from the path if it exists."""
|
|
179
179
|
if os.path.exists(self.path):
|
|
180
|
-
if not self.
|
|
181
|
-
self.
|
|
180
|
+
if not self.content_type:
|
|
181
|
+
self.content_type = self._guess_content_type()
|
|
182
182
|
if not self.size:
|
|
183
183
|
self.size = self._get_file_size()
|
|
184
184
|
if not self.filename:
|
|
@@ -189,7 +189,7 @@ class File(BaseModel):
|
|
|
189
189
|
"""Create a File instance from a file path."""
|
|
190
190
|
return cls(uri=str(path))
|
|
191
191
|
|
|
192
|
-
def
|
|
192
|
+
def _guess_content_type(self) -> Optional[str]:
|
|
193
193
|
"""Guess the MIME type of the file."""
|
|
194
194
|
return mimetypes.guess_type(self.path)[0]
|
|
195
195
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: inferencesh
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.17
|
|
4
4
|
Summary: inference.sh Python SDK
|
|
5
5
|
Author: Inference Shell Inc.
|
|
6
6
|
Author-email: "Inference Shell Inc." <hello@inference.sh>
|
|
@@ -39,7 +39,7 @@ file = File(path="/path/to/file.png")
|
|
|
39
39
|
# File with explicit metadata
|
|
40
40
|
file = File(
|
|
41
41
|
path="/path/to/file.png",
|
|
42
|
-
|
|
42
|
+
content_type="image/png",
|
|
43
43
|
filename="custom_name.png",
|
|
44
44
|
size=1024 # in bytes
|
|
45
45
|
)
|
|
@@ -51,7 +51,7 @@ file = File.from_path("/path/to/file.png")
|
|
|
51
51
|
exists = file.exists()
|
|
52
52
|
|
|
53
53
|
# Access file metadata
|
|
54
|
-
print(file.
|
|
54
|
+
print(file.content_type) # automatically detected if not specified
|
|
55
55
|
print(file.size) # file size in bytes
|
|
56
56
|
print(file.filename) # basename of the file
|
|
57
57
|
|
|
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
|