8000 [pull] master from allwefantasy:master by pull[bot] · Pull Request #43 · milomoon/auto-coder · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[pull] master from allwefantasy:master #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions src/autocoder/agent/project_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,18 @@
from autocoder.common.interpreter import Interpreter
from autocoder.common import ExecuteSteps, ExecuteStep, detect_env
from autocoder.common import code_auto_execute
from loguru import logger
import os
import io
import byzerllm
import yaml
import json
import sys
import contextlib2
from pydantic import BaseModel
from byzerllm.types import Bool
from contextlib import contextmanager
from rich.console import Console
from rich.panel import Panel
from rich.text import Text
from rich.prompt import Prompt
from autocoder.utils.queue_communicate import (
queue_communicate,
CommunicateEvent,
CommunicateEventType,
)



@contextmanager
Expand Down Expand Up @@ -438,16 +430,4 @@ def get_tree_like_directory_structure(self) -> str:
return self.pp.get_tree_like_directory_structure.prompt()

def run(self, query: str, max_iterations: int = 20):
from byzerllm.apps.llama_index.byzerai import ByzerAI
from llama_index.core.agent import ReActAgent
agent = ReActAgent.from_tools(
tools=self.tools,
llm=ByzerAI(llm=self.llm),
verbose=True,
max_iterations=max_iterations,
context=context.prompt(
project_map=self.get_tree_like_directory_structure(),
),
)
r = agent.chat(message=query)
return r.response
raise NotImplementedError("/ask is no longer supported")
8 changes: 1 addition & 7 deletions src/autocoder/auto_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,13 +907,7 @@ def intercept_callback(
from autocoder.agent.project_reader import ProjectReader

project_reader = ProjectReader(args, llm)
v = project_reader.run(args.query)
request_queue.add_request(
args.request_id,
RequestValue(
value=DefaultValue(value=v), status=RequestOption.COMPLETED
),
)
v = project_reader.run(args.query)
console = Console()
markdown_content = v

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,15 @@ def resolve(self) -> ToolResult:

# Handle the case where the implementation returns a sorted list instead of a ToolResult
if isinstance(result, list):
message = f"Successfully listed contents of '{list_path_str}' (Recursive: {recursive}). Found {len(result)} items."
return ToolResult(success=True, message=message, content=result)
total_items = len(result)
# Limit results to 200 if needed
if total_items > 200:
truncated_result = result[:200]
message = f"Successfully listed contents of '{list_path_str}' (Recursive: {recursive}). Found {total_items} items, showing only the first 200."
logger.info(message)
return ToolResult(success=True, message=message, content=truncated_result)
else:
message = f"Successfully listed contents of '{list_path_str}' (Recursive: {recursive}). Found {total_items} items."
return ToolResult(success=True, message=message, content=result)
else:
return result
0