ygg 0.1.57__py3-none-any.whl → 0.1.60__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.
- {ygg-0.1.57.dist-info → ygg-0.1.60.dist-info}/METADATA +1 -1
- ygg-0.1.60.dist-info/RECORD +74 -0
- yggdrasil/ai/__init__.py +2 -0
- yggdrasil/ai/session.py +89 -0
- yggdrasil/ai/sql_session.py +310 -0
- yggdrasil/databricks/__init__.py +0 -3
- yggdrasil/databricks/compute/cluster.py +68 -113
- yggdrasil/databricks/compute/command_execution.py +674 -0
- yggdrasil/databricks/compute/exceptions.py +19 -0
- yggdrasil/databricks/compute/execution_context.py +491 -282
- yggdrasil/databricks/compute/remote.py +4 -14
- yggdrasil/databricks/exceptions.py +10 -0
- yggdrasil/databricks/sql/__init__.py +0 -4
- yggdrasil/databricks/sql/engine.py +161 -173
- yggdrasil/databricks/sql/exceptions.py +9 -1
- yggdrasil/databricks/sql/statement_result.py +108 -120
- yggdrasil/databricks/sql/warehouse.py +331 -92
- yggdrasil/databricks/workspaces/io.py +89 -9
- yggdrasil/databricks/workspaces/path.py +120 -72
- yggdrasil/databricks/workspaces/workspace.py +214 -61
- yggdrasil/exceptions.py +7 -0
- yggdrasil/libs/databrickslib.py +23 -18
- yggdrasil/libs/extensions/spark_extensions.py +1 -1
- yggdrasil/libs/pandaslib.py +15 -6
- yggdrasil/libs/polarslib.py +49 -13
- yggdrasil/pyutils/__init__.py +1 -2
- yggdrasil/pyutils/callable_serde.py +12 -19
- yggdrasil/pyutils/exceptions.py +16 -0
- yggdrasil/pyutils/python_env.py +14 -13
- yggdrasil/pyutils/waiting_config.py +171 -0
- yggdrasil/types/cast/arrow_cast.py +3 -0
- yggdrasil/types/cast/pandas_cast.py +157 -169
- yggdrasil/types/cast/polars_cast.py +11 -43
- yggdrasil/types/dummy_class.py +81 -0
- yggdrasil/version.py +1 -1
- ygg-0.1.57.dist-info/RECORD +0 -66
- yggdrasil/databricks/ai/loki.py +0 -53
- {ygg-0.1.57.dist-info → ygg-0.1.60.dist-info}/WHEEL +0 -0
- {ygg-0.1.57.dist-info → ygg-0.1.60.dist-info}/entry_points.txt +0 -0
- {ygg-0.1.57.dist-info → ygg-0.1.60.dist-info}/licenses/LICENSE +0 -0
- {ygg-0.1.57.dist-info → ygg-0.1.60.dist-info}/top_level.txt +0 -0
- /yggdrasil/{databricks/ai/__init__.py → pyutils/mimetypes.py} +0 -0
yggdrasil/databricks/ai/loki.py
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
from typing import Optional
|
|
2
|
-
from dataclasses import field, dataclass
|
|
3
|
-
|
|
4
|
-
from ..workspaces.workspace import WorkspaceService
|
|
5
|
-
|
|
6
|
-
try:
|
|
7
|
-
from openai import OpenAI
|
|
8
|
-
|
|
9
|
-
def make_openai_client(
|
|
10
|
-
api_key: str,
|
|
11
|
-
base_url: str
|
|
12
|
-
):
|
|
13
|
-
return OpenAI(
|
|
14
|
-
api_key=api_key,
|
|
15
|
-
base_url=base_url
|
|
16
|
-
)
|
|
17
|
-
except ImportError:
|
|
18
|
-
class OpenAI:
|
|
19
|
-
pass
|
|
20
|
-
|
|
21
|
-
def make_openai_client(
|
|
22
|
-
api_key: str,
|
|
23
|
-
base_url: str
|
|
24
|
-
):
|
|
25
|
-
from openai import OpenAI
|
|
26
|
-
|
|
27
|
-
return OpenAI(
|
|
28
|
-
api_key=api_key,
|
|
29
|
-
base_url=base_url
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
__all__ = [
|
|
33
|
-
"Loki"
|
|
34
|
-
]
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
@dataclass
|
|
38
|
-
class Loki(WorkspaceService):
|
|
39
|
-
model: str = "databricks-gemini-2-5-flash"
|
|
40
|
-
|
|
41
|
-
_openai_client: Optional[OpenAI] = field(repr=False, hash=False, default=None)
|
|
42
|
-
|
|
43
|
-
@property
|
|
44
|
-
def openai_client(self):
|
|
45
|
-
if self._openai_client is None:
|
|
46
|
-
self._openai_client = self.make_openai_client()
|
|
47
|
-
return self._openai_client
|
|
48
|
-
|
|
49
|
-
def make_openai_client(self):
|
|
50
|
-
return make_openai_client(
|
|
51
|
-
api_key=self.workspace.current_token(),
|
|
52
|
-
base_url=self.workspace.host + "/serving-endpoints"
|
|
53
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|