Merge pull request #125 from crewAIInc/feat/remove-langchain

feat: remove langchain from code and update Dockerfile from CodeInterpreter
This commit is contained in:
Eduardo Chiarotti
2024-11-26 16:56:29 -03:00
committed by GitHub
2 changed files with 8 additions and 17 deletions

View File

@@ -1,11 +1,10 @@
from abc import ABC, abstractmethod
from typing import Any, Callable, Optional, Type
from typing import Any, Callable
from langchain_core.tools import StructuredTool
from pydantic import BaseModel, ConfigDict, Field, validator
from pydantic import BaseModel as PydanticBaseModel
from crewai.tools.base_tool import BaseTool
from crewai.tools.structured_tool import CrewStructuredTool
class Tool(BaseTool):
func: Callable
@@ -16,9 +15,9 @@ class Tool(BaseTool):
def to_langchain(
tools: list[BaseTool | StructuredTool],
) -> list[StructuredTool]:
return [t.to_langchain() if isinstance(t, BaseTool) else t for t in tools]
tools: list[BaseTool | CrewStructuredTool],
) -> list[CrewStructuredTool]:
return [t.to_structured_tool() if isinstance(t, BaseTool) else t for t in tools]
def tool(*args):

View File

@@ -1,14 +1,6 @@
FROM python:3.11-slim
FROM python:3.12-alpine
# Install common utilities
RUN apt-get update && apt-get install -y \
build-essential \
curl \
wget \
software-properties-common
# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip install requests beautifulsoup4
# Set the working directory
WORKDIR /workspace