truefoundry 0.10.3rc1__py3-none-any.whl → 0.10.4rc2__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.
Potentially problematic release.
This version of truefoundry might be problematic. Click here for more details.
- truefoundry/_ask/client.py +12 -4
- truefoundry/deploy/builder/builders/tfy_spark_buildpack/dockerfile_template.py +3 -0
- truefoundry/deploy/python_deploy_codegen.py +21 -1
- {truefoundry-0.10.3rc1.dist-info → truefoundry-0.10.4rc2.dist-info}/METADATA +1 -1
- {truefoundry-0.10.3rc1.dist-info → truefoundry-0.10.4rc2.dist-info}/RECORD +7 -7
- {truefoundry-0.10.3rc1.dist-info → truefoundry-0.10.4rc2.dist-info}/WHEEL +0 -0
- {truefoundry-0.10.3rc1.dist-info → truefoundry-0.10.4rc2.dist-info}/entry_points.txt +0 -0
truefoundry/_ask/client.py
CHANGED
|
@@ -94,7 +94,6 @@ class AskClient:
|
|
|
94
94
|
"""Generate authorization headers for connecting to the SSE server."""
|
|
95
95
|
return {
|
|
96
96
|
"Authorization": f"Bearer {self.token}",
|
|
97
|
-
"X-TFY-Cluster-Id": self.cluster,
|
|
98
97
|
"X-TFY-Session-Id": self._session_id,
|
|
99
98
|
}
|
|
100
99
|
|
|
@@ -317,6 +316,10 @@ class AskClient:
|
|
|
317
316
|
turn += 1
|
|
318
317
|
message = response.choices[0].message
|
|
319
318
|
|
|
319
|
+
if not message.content and not message.tool_calls:
|
|
320
|
+
self._log_message("No assistant response. Try again.", log=True)
|
|
321
|
+
break
|
|
322
|
+
|
|
320
323
|
if message.content:
|
|
321
324
|
self._append_message(
|
|
322
325
|
ChatCompletionAssistantMessageParam(
|
|
@@ -327,8 +330,7 @@ class AskClient:
|
|
|
327
330
|
if message.tool_calls:
|
|
328
331
|
await self._handle_tool_calls(message, spinner)
|
|
329
332
|
|
|
330
|
-
if
|
|
331
|
-
self._log_message("No assistant response.")
|
|
333
|
+
if message.content and not message.tool_calls:
|
|
332
334
|
break
|
|
333
335
|
except Exception as e:
|
|
334
336
|
self._log_message(f"OpenAI call failed: {e}", log=True)
|
|
@@ -402,10 +404,16 @@ class AskClient:
|
|
|
402
404
|
|
|
403
405
|
async def chat_loop(self):
|
|
404
406
|
"""Interactive loop: accepts user queries and returns responses until interrupted or 'exit' is typed."""
|
|
407
|
+
self._append_message(
|
|
408
|
+
ChatCompletionUserMessageParam(
|
|
409
|
+
role="user",
|
|
410
|
+
content=f"Selected cluster: {self.cluster}",
|
|
411
|
+
)
|
|
412
|
+
)
|
|
405
413
|
self._append_message(
|
|
406
414
|
ChatCompletionAssistantMessageParam(
|
|
407
415
|
role="assistant",
|
|
408
|
-
content="Hello! How can I help you with
|
|
416
|
+
content="Hello! How can I help you with this Kubernetes cluster?",
|
|
409
417
|
)
|
|
410
418
|
)
|
|
411
419
|
|
|
@@ -24,6 +24,9 @@ COPY ${requirements_path} ${requirements_destination_path}
|
|
|
24
24
|
% if python_packages_install_command is not None:
|
|
25
25
|
RUN ${package_manager_config_secret_mount} ${python_packages_install_command}
|
|
26
26
|
% endif
|
|
27
|
+
ENV PYTHONDONTWRITEBYTECODE=1
|
|
28
|
+
ENV IPYTHONDIR=/tmp/.ipython
|
|
29
|
+
RUN groupadd --system --gid 1001 spark && useradd --system --uid 1001 --gid spark --no-create-home spark
|
|
27
30
|
USER spark
|
|
28
31
|
COPY . /app
|
|
29
32
|
"""
|
|
@@ -8,6 +8,7 @@ from rich.console import Console
|
|
|
8
8
|
from rich.pretty import pprint
|
|
9
9
|
|
|
10
10
|
from truefoundry.deploy import Application, LocalSource
|
|
11
|
+
from truefoundry.pydantic_v1 import BaseModel
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
def generate_deployment_code(
|
|
@@ -102,7 +103,7 @@ def add_local_source_comment(code):
|
|
|
102
103
|
return "\n".join(new_lines)
|
|
103
104
|
|
|
104
105
|
|
|
105
|
-
def
|
|
106
|
+
def _convert_deployment_config_to_python(workspace_fqn: str, application_spec: dict):
|
|
106
107
|
"""
|
|
107
108
|
Convert a deployment config to a python file that can be used to deploy to a workspace
|
|
108
109
|
"""
|
|
@@ -142,6 +143,25 @@ def convert_deployment_config_to_python(workspace_fqn: str, application_spec: di
|
|
|
142
143
|
return generated_code
|
|
143
144
|
|
|
144
145
|
|
|
146
|
+
def convert_deployment_config_to_python(workspace_fqn: str, application_spec: dict):
|
|
147
|
+
original_repr_args = BaseModel.__repr_args__
|
|
148
|
+
|
|
149
|
+
def _patched_repr_args(self: BaseModel):
|
|
150
|
+
return [
|
|
151
|
+
(name, value)
|
|
152
|
+
for name, value in original_repr_args(self)
|
|
153
|
+
if name in self.__fields_set__
|
|
154
|
+
]
|
|
155
|
+
|
|
156
|
+
try:
|
|
157
|
+
BaseModel.__repr_args__ = _patched_repr_args
|
|
158
|
+
return _convert_deployment_config_to_python(
|
|
159
|
+
workspace_fqn=workspace_fqn, application_spec=application_spec
|
|
160
|
+
)
|
|
161
|
+
finally:
|
|
162
|
+
BaseModel.__repr_args__ = original_repr_args
|
|
163
|
+
|
|
164
|
+
|
|
145
165
|
def generate_python_snippet_for_trigger_job(
|
|
146
166
|
application_fqn: str, command: Optional[str], params: Optional[Dict[str, str]]
|
|
147
167
|
):
|
|
@@ -5,7 +5,7 @@ truefoundry/pydantic_v1.py,sha256=jSuhGtz0Mbk1qYu8jJ1AcnIDK4oxUsdhALc4spqstmM,34
|
|
|
5
5
|
truefoundry/version.py,sha256=bqiT4Q-VWrTC6P4qfK43mez-Ppf-smWfrl6DcwV7mrw,137
|
|
6
6
|
truefoundry/_ask/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
truefoundry/_ask/cli.py,sha256=zPaDvxhX2dITmPTtut2Iu6WAIaizrwR-U_dDZ6xv2io,5814
|
|
8
|
-
truefoundry/_ask/client.py,sha256=
|
|
8
|
+
truefoundry/_ask/client.py,sha256=QWQRiDwmtIlLaZsyGcLZaQstYFzpmJeCRdATMapjL-8,18740
|
|
9
9
|
truefoundry/_ask/llm_utils.py,sha256=ayjz7JtVu142lrm8t0cVoxLxUpx76b71y8R62z_WurY,13537
|
|
10
10
|
truefoundry/autodeploy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
truefoundry/autodeploy/cli.py,sha256=9ZxKu_MGIpraMzaW4ZyuQZhlKIQYE3biBrBV4S1h6Fo,14167
|
|
@@ -53,7 +53,7 @@ truefoundry/common/types.py,sha256=BMJFCsR1lPJAw66IQBSvLyV4I6o_x5oj78gVsUa9si8,1
|
|
|
53
53
|
truefoundry/common/utils.py,sha256=j3QP0uOsaGD_VmDDR68JTwoYE1okkAq6OqpVkzVf48Q,6424
|
|
54
54
|
truefoundry/common/warnings.py,sha256=rs6BHwk7imQYedo07iwh3TWEOywAR3Lqhj0AY4khByg,504
|
|
55
55
|
truefoundry/deploy/__init__.py,sha256=2GNbI8IGJBotz_IKaqQ-DWYWZn_pSu7lN7aId15Gk7Q,2799
|
|
56
|
-
truefoundry/deploy/python_deploy_codegen.py,sha256=
|
|
56
|
+
truefoundry/deploy/python_deploy_codegen.py,sha256=CNL1633k84Mg4hUk2azc88TrQwRWEON0f2Y8V3SGuoM,7173
|
|
57
57
|
truefoundry/deploy/_autogen/models.py,sha256=xt-DuaRDx5jeRwyGoQH2yyPZAep9Q2MHFW9XBuRzG8E,73161
|
|
58
58
|
truefoundry/deploy/builder/__init__.py,sha256=kgvlkVkiWpMVdim81tIeLrdoACqrFDgwCqHdQVsCsMo,4988
|
|
59
59
|
truefoundry/deploy/builder/constants.py,sha256=amUkHoHvVKzGv0v_knfiioRuKiJM0V0xW0diERgWiI0,508
|
|
@@ -66,7 +66,7 @@ truefoundry/deploy/builder/builders/tfy_notebook_buildpack/dockerfile_template.p
|
|
|
66
66
|
truefoundry/deploy/builder/builders/tfy_python_buildpack/__init__.py,sha256=_fjqHKn80qKi68SAMMALge7_A6e1sTsQWichw8uoGIw,2025
|
|
67
67
|
truefoundry/deploy/builder/builders/tfy_python_buildpack/dockerfile_template.py,sha256=f4l3fH21E2b8W3-JotMKc0AdPcCxV7LRPxxYJa7z_UQ,9134
|
|
68
68
|
truefoundry/deploy/builder/builders/tfy_spark_buildpack/__init__.py,sha256=NEPlM6_vTVxp4ITa18B8DBbgYCn1q5d8be21lbgu5oY,2888
|
|
69
|
-
truefoundry/deploy/builder/builders/tfy_spark_buildpack/dockerfile_template.py,sha256=
|
|
69
|
+
truefoundry/deploy/builder/builders/tfy_spark_buildpack/dockerfile_template.py,sha256=dAmWgAHcNdBLSedpz18r5r7n9hdXKV-PB7yFPMdaoww,5990
|
|
70
70
|
truefoundry/deploy/builder/builders/tfy_spark_buildpack/tfy_execute_notebook.py,sha256=PKJWNlW76dRw_XtFkRnqpzwBGuXU4w6_kIJkgoBmZ5Q,1975
|
|
71
71
|
truefoundry/deploy/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
72
72
|
truefoundry/deploy/cli/commands/__init__.py,sha256=qv818jxqSAygJ3h-6Ul8t-5VOgR_UrSgsVtNCl3e5G0,1408
|
|
@@ -381,7 +381,7 @@ truefoundry/workflow/remote_filesystem/__init__.py,sha256=LQ95ViEjJ7Ts4JcCGOxMPs
|
|
|
381
381
|
truefoundry/workflow/remote_filesystem/logger.py,sha256=em2l7D6sw7xTLDP0kQSLpgfRRCLpN14Qw85TN7ujQcE,1022
|
|
382
382
|
truefoundry/workflow/remote_filesystem/tfy_signed_url_client.py,sha256=xcT0wQmQlgzcj0nP3tJopyFSVWT1uv3nhiTIuwfXYeg,12342
|
|
383
383
|
truefoundry/workflow/remote_filesystem/tfy_signed_url_fs.py,sha256=nSGPZu0Gyd_jz0KsEE-7w_BmnTD8CVF1S8cUJoxaCbc,13305
|
|
384
|
-
truefoundry-0.10.
|
|
385
|
-
truefoundry-0.10.
|
|
386
|
-
truefoundry-0.10.
|
|
387
|
-
truefoundry-0.10.
|
|
384
|
+
truefoundry-0.10.4rc2.dist-info/METADATA,sha256=SJpxZlTvIDJc5NOKQZdbj-K4z1tv0Dqct9vdAwYuKYw,2508
|
|
385
|
+
truefoundry-0.10.4rc2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
386
|
+
truefoundry-0.10.4rc2.dist-info/entry_points.txt,sha256=xVjn7RMN-MW2-9f7YU-bBdlZSvvrwzhpX1zmmRmsNPU,98
|
|
387
|
+
truefoundry-0.10.4rc2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|