feat: change the anme of user dockerfile path

This commit is contained in:
Eduardo Chiarotti
2024-08-27 09:01:09 -03:00
parent 8007938d6b
commit d146e4a961
2 changed files with 4 additions and 6 deletions

View File

@@ -35,6 +35,6 @@ from crewai_tools import CodeInterpreterTool
Agent(
...
tools=[CodeInterpreterTool(user_docker_file_path="<Dockerfile_path>")],
tools=[CodeInterpreterTool(user_dockerfile_path="<Dockerfile_path>")],
)
```

View File

@@ -27,7 +27,7 @@ class CodeInterpreterTool(BaseTool):
args_schema: Type[BaseModel] = CodeInterpreterSchema
default_image_tag: str = "code-interpreter:latest"
code: Optional[str] = None
user_docker_file_path: Optional[str] = None
user_dockerfile_path: Optional[str] = None
@staticmethod
def _get_installed_package_path():
@@ -44,10 +44,8 @@ class CodeInterpreterTool(BaseTool):
client.images.get(self.default_image_tag)
except docker.errors.ImageNotFound:
if self.user_docker_file_path and os.path.exists(
self.user_docker_file_path
):
dockerfile_path = self.user_docker_file_path
if self.user_dockerfile_path and os.path.exists(self.user_dockerfile_path):
dockerfile_path = self.user_dockerfile_path
else:
package_path = self._get_installed_package_path()
dockerfile_path = os.path.join(