oocana 0.16.4__py3-none-any.whl → 0.16.6__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.
- oocana/context.py +12 -2
- oocana/data.py +2 -9
- {oocana-0.16.4.dist-info → oocana-0.16.6.dist-info}/METADATA +1 -2
- {oocana-0.16.4.dist-info → oocana-0.16.6.dist-info}/RECORD +6 -6
- {oocana-0.16.4.dist-info → oocana-0.16.6.dist-info}/WHEEL +0 -0
- {oocana-0.16.4.dist-info → oocana-0.16.6.dist-info}/entry_points.txt +0 -0
oocana/context.py
CHANGED
@@ -136,7 +136,7 @@ class Context:
|
|
136
136
|
"api_key": os.getenv("OOMOL_LLM_API_KEY", ""),
|
137
137
|
"models": os.getenv("OOMOL_LLM_MODELS", "").split(","),
|
138
138
|
}
|
139
|
-
|
139
|
+
|
140
140
|
@property
|
141
141
|
def host_info(self) -> HostInfo:
|
142
142
|
"""this is a dict contains the host information
|
@@ -145,7 +145,17 @@ class Context:
|
|
145
145
|
"gpu_vendor": os.getenv("OOMOL_HOST_GPU_VENDOR", "unknown"),
|
146
146
|
"gpu_renderer": os.getenv("OOMOL_HOST_GPU_RENDERER", "unknown"),
|
147
147
|
}
|
148
|
-
|
148
|
+
|
149
|
+
@property
|
150
|
+
def host_endpoint(self) -> str | None:
|
151
|
+
"""A host endpoint that allows containers to access services running on the host system.
|
152
|
+
|
153
|
+
Returns:
|
154
|
+
str: The host endpoint if available.
|
155
|
+
None: If the application is running in a cloud environment where no host endpoint is defined.
|
156
|
+
"""
|
157
|
+
return os.getenv("OO_HOST_ENDPOINT", None)
|
158
|
+
|
149
159
|
@property
|
150
160
|
def is_done(self) -> bool:
|
151
161
|
return self.__is_done
|
oocana/data.py
CHANGED
@@ -29,17 +29,10 @@ class JobDict(TypedDict):
|
|
29
29
|
job_id: str
|
30
30
|
|
31
31
|
class BlockDict(TypedDict):
|
32
|
-
|
33
|
-
try:
|
34
|
-
# NotRequired, Required was added in version 3.11
|
35
|
-
from typing import NotRequired, Required, TypedDict # type: ignore
|
36
|
-
except ImportError:
|
37
|
-
from typing_extensions import NotRequired, Required, TypedDict
|
38
|
-
|
39
32
|
session_id: str
|
40
33
|
job_id: str
|
41
34
|
stacks: list
|
42
|
-
block_path: NotRequired
|
35
|
+
block_path: str | None # better to use NotRequired here, but it is not supported in python 3.10 and type_extensions requires high version, For compatibility, use None instead of NotRequired.
|
43
36
|
|
44
37
|
# dataclass 默认字段必须一一匹配
|
45
38
|
# 如果多一个或者少一个字段,就会报错。
|
@@ -84,7 +77,7 @@ class BlockInfo:
|
|
84
77
|
"session_id": self.session_id,
|
85
78
|
"job_id": self.job_id,
|
86
79
|
"stacks": self.stacks,
|
87
|
-
}
|
80
|
+
} # type: ignore[return-value]
|
88
81
|
|
89
82
|
return {
|
90
83
|
"session_id": self.session_id,
|
@@ -1,10 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: oocana
|
3
|
-
Version: 0.16.
|
3
|
+
Version: 0.16.6
|
4
4
|
Summary: python implement of oocana to give a context for oocana block
|
5
5
|
License: MIT
|
6
6
|
Requires-Python: >=3.9
|
7
7
|
Requires-Dist: paho-mqtt>=2
|
8
8
|
Requires-Dist: simplejson>=3.19.2
|
9
|
-
Requires-Dist: typing-extensions>=4.12.2; python_version < "3.11"
|
10
9
|
|
@@ -1,13 +1,13 @@
|
|
1
|
-
oocana-0.16.
|
2
|
-
oocana-0.16.
|
3
|
-
oocana-0.16.
|
1
|
+
oocana-0.16.6.dist-info/METADATA,sha256=KveWTqPJWZn9CclgQxpwJ5bJr5AhXLWWwbksOeZKvS4,221
|
2
|
+
oocana-0.16.6.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
3
|
+
oocana-0.16.6.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
|
4
4
|
oocana/__init__.py,sha256=zMrQ1asZoRE91-BShf1v2ibdThaMc07YtZt5iNbbxsg,281
|
5
|
-
oocana/context.py,sha256=
|
6
|
-
oocana/data.py,sha256=
|
5
|
+
oocana/context.py,sha256=a8sap8qfXWGlu3JrUgj-rgQ5AdKp8yPuiF5IZCLZQQ0,13542
|
6
|
+
oocana/data.py,sha256=0KpJyckz_X5JbrncBRFbOaU00CxcDx2UYHk6xuH1Poc,2890
|
7
7
|
oocana/handle_data.py,sha256=p0iEvdsVV3BqcelM8rvq0a_VPI52SeahaGCszfhZ0TI,1927
|
8
8
|
oocana/mainframe.py,sha256=Jixk9PjvJh7PnYwPGqOR5viwcOHWfaPhEiQFNHxHCxw,5219
|
9
9
|
oocana/preview.py,sha256=sAKcVUFmOMvrzYLrvqAxd26SppSvK1qJqRTHdAS-KDc,1959
|
10
10
|
oocana/schema.py,sha256=8LwMaW4eXa3EmKxR4kzyTOpZiClMRMMsMA6f9CXodW4,4332
|
11
11
|
oocana/service.py,sha256=dPCcScQfMBlEjIodFnKU17-HlbBzrQbQK6CNRw7SmOE,2442
|
12
12
|
oocana/throtter.py,sha256=xTldm2OZ5uYPiyC6Aatug4FJAoMylPjtXftxHvSr_50,1104
|
13
|
-
oocana-0.16.
|
13
|
+
oocana-0.16.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|