From 3e2ef2c9794f77ae7c9809c99979c5f50ba28da2 Mon Sep 17 00:00:00 2001 From: tawsifkamal Date: Thu, 20 Mar 2025 14:04:53 -0700 Subject: [PATCH] done --- src/codegen/extensions/langchain/agent.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/codegen/extensions/langchain/agent.py b/src/codegen/extensions/langchain/agent.py index 42493c1fc..551db5b46 100644 --- a/src/codegen/extensions/langchain/agent.py +++ b/src/codegen/extensions/langchain/agent.py @@ -63,7 +63,7 @@ def create_codebase_agent( """ llm = LLM(model_provider=model_provider, model_name=model_name, **kwargs) - # Get all codebase tools + # Initialize default tools tools = [ ViewFileTool(codebase), ListDirectoryTool(codebase), @@ -80,17 +80,13 @@ def create_codebase_agent( ReflectionTool(codebase), SearchFilesByNameTool(codebase), GlobalReplacementEditTool(codebase), - # SemanticSearchTool(codebase), - # =====[ Github Integration ]===== - # Enable Github integration - # GithubCreatePRTool(codebase), - # GithubViewPRTool(codebase), - # GithubCreatePRCommentTool(codebase), - # GithubCreatePRReviewCommentTool(codebase), ] - # Add additional tools if provided if additional_tools: + # Get names of additional tools + additional_names = {t.get_name() for t in additional_tools} + # Keep only tools that don't have matching names in additional_tools + tools = [t for t in tools if t.get_name() not in additional_names] tools.extend(additional_tools) memory = MemorySaver() if memory else None