truefoundry 0.2.0rc1__py3-none-any.whl → 0.2.0rc3__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/autodeploy/agents/base.py +4 -3
- truefoundry/autodeploy/agents/tester.py +2 -1
- truefoundry/autodeploy/cli.py +4 -4
- truefoundry/autodeploy/tools/ask.py +2 -1
- truefoundry/autodeploy/tools/commit.py +2 -1
- truefoundry/autodeploy/tools/docker_run.py +1 -0
- truefoundry/autodeploy/utils/pydantic_compat.py +19 -0
- {truefoundry-0.2.0rc1.dist-info → truefoundry-0.2.0rc3.dist-info}/METADATA +9 -10
- {truefoundry-0.2.0rc1.dist-info → truefoundry-0.2.0rc3.dist-info}/RECORD +11 -10
- {truefoundry-0.2.0rc1.dist-info → truefoundry-0.2.0rc3.dist-info}/WHEEL +0 -0
- {truefoundry-0.2.0rc1.dist-info → truefoundry-0.2.0rc3.dist-info}/entry_points.txt +0 -0
|
@@ -22,6 +22,7 @@ from pydantic import BaseModel, ValidationError
|
|
|
22
22
|
from truefoundry.autodeploy.constants import AUTODEPLOY_MODEL_NAME
|
|
23
23
|
from truefoundry.autodeploy.logger import logger
|
|
24
24
|
from truefoundry.autodeploy.tools import Event, RequestEvent, Tool
|
|
25
|
+
from truefoundry.autodeploy.utils.pydantic_compat import model_dump, model_json_schema
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
def llm(
|
|
@@ -50,7 +51,7 @@ def format_tool_response(
|
|
|
50
51
|
) -> ChatCompletionToolMessageParam:
|
|
51
52
|
return ChatCompletionToolMessageParam(
|
|
52
53
|
role="tool",
|
|
53
|
-
content=json.dumps(
|
|
54
|
+
content=json.dumps(model_dump(response), indent=1),
|
|
54
55
|
tool_call_id=tool_call_id,
|
|
55
56
|
)
|
|
56
57
|
|
|
@@ -72,7 +73,7 @@ def get_tool_descriptions(
|
|
|
72
73
|
function=FunctionDefinition(
|
|
73
74
|
name=tool.__class__.__name__,
|
|
74
75
|
description=tool.description.strip(),
|
|
75
|
-
parameters=tool.Request
|
|
76
|
+
parameters=model_json_schema(tool.Request),
|
|
76
77
|
),
|
|
77
78
|
)
|
|
78
79
|
descriptions.append(tool)
|
|
@@ -82,7 +83,7 @@ def get_tool_descriptions(
|
|
|
82
83
|
type="function",
|
|
83
84
|
function=FunctionDefinition(
|
|
84
85
|
name="Response",
|
|
85
|
-
parameters=
|
|
86
|
+
parameters=model_json_schema(response),
|
|
86
87
|
),
|
|
87
88
|
)
|
|
88
89
|
descriptions.append(tool)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from typing import Dict
|
|
3
|
+
from typing import Dict, Optional
|
|
4
4
|
|
|
5
5
|
import docker
|
|
6
6
|
from openai import OpenAI
|
|
@@ -39,6 +39,7 @@ Return response once you are done testing.
|
|
|
39
39
|
project_identity: ProjectIdentifier.Response
|
|
40
40
|
image_tag: str
|
|
41
41
|
command: str
|
|
42
|
+
port_to_be_exposed: Optional[int] = None
|
|
42
43
|
|
|
43
44
|
class Response(ResponseEvent):
|
|
44
45
|
successful: bool = Field(..., description="is everything fine?")
|
truefoundry/autodeploy/cli.py
CHANGED
|
@@ -138,7 +138,8 @@ def _check_repo(project_root_path: str, console: Console):
|
|
|
138
138
|
|
|
139
139
|
except InvalidGitRepositoryError:
|
|
140
140
|
console.print(
|
|
141
|
-
"[red]Error:[/] This operation can only be performed inside a Git repository
|
|
141
|
+
"[red]Error:[/] This operation can only be performed inside a Git repository.\n"
|
|
142
|
+
"Execute 'git init' to create a new repository."
|
|
142
143
|
)
|
|
143
144
|
sys.exit(1)
|
|
144
145
|
|
|
@@ -198,9 +199,8 @@ def cli(project_root_path: str, deploy: bool):
|
|
|
198
199
|
"[bold magenta]TFY-Agent[/]: A tool for building and deploying [magenta]Jobs/Services[/] to the Truefoundry platform."
|
|
199
200
|
)
|
|
200
201
|
console.print(
|
|
201
|
-
"[bold reverse red]DISCLAIMER:[/] The
|
|
202
|
+
"[bold reverse red]DISCLAIMER:[/] The contents of the project will be sent to OpenAI."
|
|
202
203
|
)
|
|
203
|
-
console.print("Let's get started! Please answer the following questions:")
|
|
204
204
|
console.print(
|
|
205
205
|
"[bold cyan]Note:[/] All changes will be committed to a new branch. Please ensure you have a repository."
|
|
206
206
|
)
|
|
@@ -298,7 +298,7 @@ def cli(project_root_path: str, deploy: bool):
|
|
|
298
298
|
"--deploy",
|
|
299
299
|
type=click.BOOL,
|
|
300
300
|
is_flag=True,
|
|
301
|
-
default=
|
|
301
|
+
default=True,
|
|
302
302
|
show_default=True,
|
|
303
303
|
help="Deploy the project after successfully building it.",
|
|
304
304
|
)
|
|
@@ -5,6 +5,7 @@ from typing import Iterable
|
|
|
5
5
|
from rich.console import Console
|
|
6
6
|
|
|
7
7
|
from truefoundry.autodeploy.tools.base import Event, RequestEvent, ResponseEvent, Tool
|
|
8
|
+
from truefoundry.autodeploy.utils.pydantic_compat import model_dump
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AskQuestion(Event):
|
|
@@ -28,5 +29,5 @@ Ask a question to the user.
|
|
|
28
29
|
response: str
|
|
29
30
|
|
|
30
31
|
def run(self, request: Ask.Request) -> Iterable[Event]:
|
|
31
|
-
response = yield AskQuestion(**
|
|
32
|
+
response = yield AskQuestion(**model_dump(request))
|
|
32
33
|
return Ask.Response(response=response)
|
|
@@ -19,6 +19,7 @@ from truefoundry.autodeploy.tools.base import (
|
|
|
19
19
|
Tool,
|
|
20
20
|
)
|
|
21
21
|
from truefoundry.autodeploy.utils.diff import LLMDiff
|
|
22
|
+
from truefoundry.autodeploy.utils.pydantic_compat import model_dump
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
class CommitConfirmation(Event):
|
|
@@ -116,7 +117,7 @@ The patch should have any changes that is not described in the commit message.
|
|
|
116
117
|
) -> Generator[Event, Any, ResponseEvent]:
|
|
117
118
|
fp = tempfile.NamedTemporaryFile(mode="w", delete=False)
|
|
118
119
|
try:
|
|
119
|
-
interaction_response = yield CommitConfirmation(**
|
|
120
|
+
interaction_response = yield CommitConfirmation(**model_dump(request))
|
|
120
121
|
if isinstance(interaction_response, Commit.Response):
|
|
121
122
|
return interaction_response
|
|
122
123
|
fp.write(request.patch)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from typing import Any, Dict, Type
|
|
2
|
+
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
PYDANTIC_V2 = pydantic.VERSION.startswith("2.")
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def model_dump(
|
|
9
|
+
model: pydantic.BaseModel,
|
|
10
|
+
) -> Dict[str, Any]:
|
|
11
|
+
if PYDANTIC_V2:
|
|
12
|
+
return model.model_dump()
|
|
13
|
+
return model.dict()
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def model_json_schema(model: Type[pydantic.BaseModel]) -> Dict[str, Any]:
|
|
17
|
+
if PYDANTIC_V2:
|
|
18
|
+
return model.model_json_schema()
|
|
19
|
+
return model.schema()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: truefoundry
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.0rc3
|
|
4
4
|
Summary: Truefoundry CLI
|
|
5
5
|
Author: Abhishek Choudhary
|
|
6
6
|
Author-email: abhichoudhary06@gmail.com
|
|
@@ -11,17 +11,16 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
-
Provides-Extra: autodeploy
|
|
15
14
|
Provides-Extra: ml
|
|
16
|
-
Requires-Dist: docker (>=7.0.0,<8.0.0)
|
|
17
|
-
Requires-Dist: gitignorefile (>=1.1.2,<2.0.0)
|
|
18
|
-
Requires-Dist: gitpython (>=3.1.43,<4.0.0)
|
|
15
|
+
Requires-Dist: docker (>=7.0.0,<8.0.0)
|
|
16
|
+
Requires-Dist: gitignorefile (>=1.1.2,<2.0.0)
|
|
17
|
+
Requires-Dist: gitpython (>=3.1.43,<4.0.0)
|
|
19
18
|
Requires-Dist: mlfoundry (==0.10.9) ; extra == "ml"
|
|
20
|
-
Requires-Dist: openai (>=1.16.2,<2.0.0)
|
|
21
|
-
Requires-Dist: pydantic (>=
|
|
22
|
-
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
|
23
|
-
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
|
24
|
-
Requires-Dist: rich (>=13.7.1,<14.0.0)
|
|
19
|
+
Requires-Dist: openai (>=1.16.2,<2.0.0)
|
|
20
|
+
Requires-Dist: pydantic (>=1.10.0,<3)
|
|
21
|
+
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
|
22
|
+
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
|
23
|
+
Requires-Dist: rich (>=13.7.1,<14.0.0)
|
|
25
24
|
Requires-Dist: servicefoundry (==0.10.6)
|
|
26
25
|
Description-Content-Type: text/markdown
|
|
27
26
|
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
truefoundry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
truefoundry/autodeploy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
truefoundry/autodeploy/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
truefoundry/autodeploy/agents/base.py,sha256=
|
|
4
|
+
truefoundry/autodeploy/agents/base.py,sha256=woCry229x7WX0IZmBopW_e_NB76aCLQRLXZBs2QBklk,6405
|
|
5
5
|
truefoundry/autodeploy/agents/developer.py,sha256=u1BfjaMDX6Ad32vWYOEFZPWFK33ux0Ro8JztrRAFviY,4126
|
|
6
6
|
truefoundry/autodeploy/agents/project_identifier.py,sha256=m8xg7U5D2zSLEKp5QyPZRldw4VPuTFM8omPCRC0Ri-w,4428
|
|
7
|
-
truefoundry/autodeploy/agents/tester.py,sha256=
|
|
8
|
-
truefoundry/autodeploy/cli.py,sha256=
|
|
7
|
+
truefoundry/autodeploy/agents/tester.py,sha256=iSnWHubzHPO36Je2nYQYsdxL64xVQ3DxvEnakEJAW1Q,2348
|
|
8
|
+
truefoundry/autodeploy/cli.py,sha256=QWOf3YrUzgfvglaS43MYyi3LnmWLBbZF8ntZsvVKTN0,10572
|
|
9
9
|
truefoundry/autodeploy/constants.py,sha256=4ZHn08CCs_6ti-8Y6zaM_5IhI9mrB-1eDALhbn36oIw,435
|
|
10
10
|
truefoundry/autodeploy/exception.py,sha256=BHqbkN-RdEsrfqPHQhWwSHiWnwQ6eaBc7PGGEXjJ3RY,54
|
|
11
11
|
truefoundry/autodeploy/logger.py,sha256=tkV2UKcOTFl5nz0cn4eRbzxF-2CZd8b7MK9vnhaflYw,325
|
|
12
12
|
truefoundry/autodeploy/tools/__init__.py,sha256=9zJiC1d4bv9EL-p5XTCa9fAQ6ZKV--AbgeLz9bBBkyQ,875
|
|
13
|
-
truefoundry/autodeploy/tools/ask.py,sha256=
|
|
13
|
+
truefoundry/autodeploy/tools/ask.py,sha256=fOKZiN7xI11OyGXG7RABwy6OPf_KGx48NhY8vggB-g4,854
|
|
14
14
|
truefoundry/autodeploy/tools/base.py,sha256=X7bBhJ2-mkc1_uo9dLtIoZOgKsvoCsmvCzdh_j0rdys,665
|
|
15
|
-
truefoundry/autodeploy/tools/commit.py,sha256=
|
|
15
|
+
truefoundry/autodeploy/tools/commit.py,sha256=gmA_TFPGVtXHYTHeeca8OXI9c11BSCTSywQjkiAeqDQ,5890
|
|
16
16
|
truefoundry/autodeploy/tools/docker_build.py,sha256=6LfWLJYh3Y3kCIVOC8lFcZjWHIk3iWEuw_qoAxx642k,3931
|
|
17
|
-
truefoundry/autodeploy/tools/docker_run.py,sha256=
|
|
17
|
+
truefoundry/autodeploy/tools/docker_run.py,sha256=9TpT4rcpeJTpsSg0YwQpqF-mYPyxnUUCKcHkD-VoO_M,5076
|
|
18
18
|
truefoundry/autodeploy/tools/file_type_counts.py,sha256=4p6IHp-j1vBzELpepFhNwfmB88cUUAFdVDQdzv4lGtM,2288
|
|
19
19
|
truefoundry/autodeploy/tools/list_files.py,sha256=9z_Nih_N8v7qe14znl7_-3MKZjw5RylVyy7L8qvU1es,2577
|
|
20
20
|
truefoundry/autodeploy/tools/read_file.py,sha256=h1xdwRMxuRTLX4ZprzSgfkpuu52FbYNrQUJDBW3Ck4A,1751
|
|
21
21
|
truefoundry/autodeploy/tools/send_request.py,sha256=5q_fAo0tXRiHg9M3XpdwhCzUtDUWVh17239oU4LkZfI,1614
|
|
22
22
|
truefoundry/autodeploy/tools/write_file.py,sha256=EcYetnJ4X-NWsd_CdYUKfOnAdz2XXiRukTzJfb_GzFs,3130
|
|
23
23
|
truefoundry/autodeploy/utils/diff.py,sha256=Ef8Y-VffDKel_-q-GxRam6gqiv8qTLMcqVg6iifXfcA,5358
|
|
24
|
+
truefoundry/autodeploy/utils/pydantic_compat.py,sha256=hEAUy5kLjhPdzw7yGZ2iXGMXbbMVXVlGzIofmyHafXQ,412
|
|
24
25
|
truefoundry/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
26
|
truefoundry/cli/__main__.py,sha256=gSKVAG41klzNpe0IrURtRlR7zDo430tX0nEqR02L2SU,1585
|
|
26
27
|
truefoundry/deploy/__init__.py,sha256=rY-AcjgSmu0r072rdUNpRkMmDFC7hH9drF5_pIN5jnw,29
|
|
27
28
|
truefoundry/langchain/__init__.py,sha256=R1h2DkLLsVLPh3xVVzU2H_kpN4LNgzx3mPCcGVr2u5g,39
|
|
28
29
|
truefoundry/ml/__init__.py,sha256=SJiI5QimXJETfME2x0iXz8gPn6C22YNiLiEdHIV1g7c,151
|
|
29
|
-
truefoundry-0.2.
|
|
30
|
-
truefoundry-0.2.
|
|
31
|
-
truefoundry-0.2.
|
|
32
|
-
truefoundry-0.2.
|
|
30
|
+
truefoundry-0.2.0rc3.dist-info/METADATA,sha256=CuNSdxJPNngMDunPDi-FFb4hULsoPeqZ9_a85jgwbp0,1838
|
|
31
|
+
truefoundry-0.2.0rc3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
32
|
+
truefoundry-0.2.0rc3.dist-info/entry_points.txt,sha256=TXvUxQkI6zmqJuycPsyxEIMr3oqfDjgrWj0m_9X12x4,95
|
|
33
|
+
truefoundry-0.2.0rc3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|