oocana 0.16.7__tar.gz → 0.16.9__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.
- {oocana-0.16.7 → oocana-0.16.9}/PKG-INFO +1 -1
- {oocana-0.16.7 → oocana-0.16.9}/oocana/__init__.py +2 -1
- {oocana-0.16.7 → oocana-0.16.9}/oocana/context.py +5 -4
- oocana-0.16.9/oocana/extra.py +13 -0
- {oocana-0.16.7 → oocana-0.16.9}/oocana/preview.py +3 -0
- {oocana-0.16.7 → oocana-0.16.9}/pyproject.toml +1 -1
- {oocana-0.16.7 → oocana-0.16.9}/oocana/data.py +0 -0
- {oocana-0.16.7 → oocana-0.16.9}/oocana/handle_data.py +0 -0
- {oocana-0.16.7 → oocana-0.16.9}/oocana/mainframe.py +0 -0
- {oocana-0.16.7 → oocana-0.16.9}/oocana/schema.py +0 -0
- {oocana-0.16.7 → oocana-0.16.9}/oocana/service.py +0 -0
- {oocana-0.16.7 → oocana-0.16.9}/oocana/throtter.py +0 -0
- {oocana-0.16.7 → oocana-0.16.9}/tests/__init__.py +0 -0
- {oocana-0.16.7 → oocana-0.16.9}/tests/test_data.py +0 -0
- {oocana-0.16.7 → oocana-0.16.9}/tests/test_handle_data.py +0 -0
- {oocana-0.16.7 → oocana-0.16.9}/tests/test_json.py +0 -0
- {oocana-0.16.7 → oocana-0.16.9}/tests/test_mainframe.py +0 -0
- {oocana-0.16.7 → oocana-0.16.9}/tests/test_performance.py +0 -0
- {oocana-0.16.7 → oocana-0.16.9}/tests/test_schema.py +0 -0
- {oocana-0.16.7 → oocana-0.16.9}/tests/test_throtter.py +0 -0
@@ -3,5 +3,6 @@ from .context import * # noqa: F403
|
|
3
3
|
from .service import * # noqa: F403
|
4
4
|
from .handle_data import * # noqa: F403
|
5
5
|
from .preview import * # noqa: F403
|
6
|
+
from .extra import * # noqa: F403
|
6
7
|
from .schema import * # noqa: F403
|
7
|
-
from .mainframe import Mainframe as Mainframe # noqa: F403
|
8
|
+
from .mainframe import Mainframe as Mainframe # noqa: F403
|
@@ -278,7 +278,7 @@ class Context:
|
|
278
278
|
if isinstance(df, ShapeDataFrame):
|
279
279
|
row_count = df.shape[0]
|
280
280
|
if row_count <= 10:
|
281
|
-
data = df.
|
281
|
+
data = loads(df.to_json(orient='split'))
|
282
282
|
columns = data.get("columns", [])
|
283
283
|
rows = data.get("data", [])
|
284
284
|
if not_default_index(df):
|
@@ -287,8 +287,9 @@ class Context:
|
|
287
287
|
columns = ["", *columns]
|
288
288
|
|
289
289
|
elif isinstance(df, PartialDataFrame):
|
290
|
-
need_add_index =
|
291
|
-
|
290
|
+
need_add_index = False # TODO: some index is not begin with 0, current just always hide index
|
291
|
+
# to_json will serialize some default json dumps not supported type like datetime, so we just use to_json for now.
|
292
|
+
head_data = loads(df.head(5).to_json(orient='split'))
|
292
293
|
columns = head_data.get("columns", [])
|
293
294
|
|
294
295
|
rows_head = head_data.get("data", [])
|
@@ -297,7 +298,7 @@ class Context:
|
|
297
298
|
head_index = head_data.get("index", [])
|
298
299
|
rows_head = [[head_index[i], *rows_head[i]] for i in range(len(rows_head))]
|
299
300
|
|
300
|
-
tail_data = df.tail(5).
|
301
|
+
tail_data = loads(df.tail(5).to_json(orient='split'))
|
301
302
|
rows_tail = tail_data.get("data", [])
|
302
303
|
if need_add_index:
|
303
304
|
tail_index = tail_data.get("index", [])
|
@@ -0,0 +1,13 @@
|
|
1
|
+
from typing import Literal, TypedDict
|
2
|
+
|
3
|
+
__all__ = ["LLMModelOptions", "LLMMessage"]
|
4
|
+
|
5
|
+
class LLMModelOptions(TypedDict):
|
6
|
+
model: str
|
7
|
+
temperature: float
|
8
|
+
top_p: float
|
9
|
+
max_tokens: int
|
10
|
+
|
11
|
+
class LLMMessage(TypedDict):
|
12
|
+
role: Literal["system", "user", "assistant"]
|
13
|
+
content: str
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|