truefoundry 0.2.0rc1__tar.gz → 0.2.0rc3__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.

Potentially problematic release.


This version of truefoundry might be problematic. Click here for more details.

Files changed (32) hide show
  1. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/PKG-INFO +9 -10
  2. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/pyproject.toml +9 -10
  3. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/agents/base.py +4 -3
  4. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/agents/tester.py +2 -1
  5. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/cli.py +4 -4
  6. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/tools/ask.py +2 -1
  7. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/tools/commit.py +2 -1
  8. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/tools/docker_run.py +1 -0
  9. truefoundry-0.2.0rc3/truefoundry/autodeploy/utils/pydantic_compat.py +19 -0
  10. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/README.md +0 -0
  11. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/__init__.py +0 -0
  12. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/__init__.py +0 -0
  13. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/agents/__init__.py +0 -0
  14. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/agents/developer.py +0 -0
  15. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/agents/project_identifier.py +0 -0
  16. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/constants.py +0 -0
  17. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/exception.py +0 -0
  18. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/logger.py +0 -0
  19. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/tools/__init__.py +0 -0
  20. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/tools/base.py +0 -0
  21. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/tools/docker_build.py +0 -0
  22. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/tools/file_type_counts.py +0 -0
  23. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/tools/list_files.py +0 -0
  24. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/tools/read_file.py +0 -0
  25. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/tools/send_request.py +0 -0
  26. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/tools/write_file.py +0 -0
  27. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/autodeploy/utils/diff.py +0 -0
  28. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/cli/__init__.py +0 -0
  29. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/cli/__main__.py +0 -0
  30. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/deploy/__init__.py +0 -0
  31. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/langchain/__init__.py +0 -0
  32. {truefoundry-0.2.0rc1 → truefoundry-0.2.0rc3}/truefoundry/ml/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: truefoundry
3
- Version: 0.2.0rc1
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) ; extra == "autodeploy"
17
- Requires-Dist: gitignorefile (>=1.1.2,<2.0.0) ; extra == "autodeploy"
18
- Requires-Dist: gitpython (>=3.1.43,<4.0.0) ; extra == "autodeploy"
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) ; extra == "autodeploy"
21
- Requires-Dist: pydantic (>=2.6.4,<3.0.0) ; extra == "autodeploy"
22
- Requires-Dist: python-dotenv (>=1.0.1,<2.0.0) ; extra == "autodeploy"
23
- Requires-Dist: requests (>=2.31.0,<3.0.0) ; extra == "autodeploy"
24
- Requires-Dist: rich (>=13.7.1,<14.0.0) ; extra == "autodeploy"
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,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "truefoundry"
3
- version = "0.2.0rc1"
3
+ version = "0.2.0rc3"
4
4
  description = "Truefoundry CLI"
5
5
  authors = ["Abhishek Choudhary <abhichoudhary06@gmail.com>"]
6
6
  readme = "README.md"
@@ -9,18 +9,17 @@ readme = "README.md"
9
9
  python = "^3.8,<3.13"
10
10
  servicefoundry = "0.10.6"
11
11
  mlfoundry = { version = "0.10.9", optional = true }
12
- openai = {version = "^1.16.2", optional = true}
13
- docker = {version = "^7.0.0", optional = true}
14
- pydantic = {version = "^2.6.4", optional = true}
15
- rich = {version = "^13.7.1", optional = true}
16
- requests = {version = "^2.31.0", optional = true}
17
- python-dotenv = {version = "^1.0.1", optional = true}
18
- gitignorefile = {version = "^1.1.2", optional = true}
19
- gitpython = {version = "^3.1.43", optional = true}
12
+ openai = "^1.16.2"
13
+ docker = "^7.0.0"
14
+ pydantic = ">=1.10.0,<3"
15
+ rich = "^13.7.1"
16
+ requests = "^2.31.0"
17
+ python-dotenv = "^1.0.1"
18
+ gitignorefile = "^1.1.2"
19
+ gitpython = "^3.1.43"
20
20
 
21
21
  [tool.poetry.extras]
22
22
  ml = ["mlfoundry"]
23
- autodeploy = ["openai", "docker", "pydantic", "rich", "requests", "python-dotenv", "gitignorefile", "gitpython"]
24
23
 
25
24
  [tool.poetry.group.dev.dependencies]
26
25
  ruff = "^0.3.5"
@@ -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(response.model_dump(), indent=1),
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.model_json_schema(),
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=response.model_json_schema(),
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?")
@@ -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 [bold magenta]TFY-Agent[/] may use LLM resources outside of your organization. Please proceed only if you accept this."
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=False,
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(**request.model_dump())
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(**request.model_dump())
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)
@@ -40,6 +40,7 @@ Run a docker image
40
40
  ports: Optional[Dict[str, int]] = Field(
41
41
  None,
42
42
  description="""
43
+ Ports to expose.
43
44
  The keys of the dictionary are the ports to bind inside the container in 'port'.
44
45
  The values are the ports to open on the host""",
45
46
  )
@@ -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()
File without changes