Skip to content
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
12 changes: 5 additions & 7 deletions prometheus/app/api/routes/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,12 @@ async def upload_github_repository(
upload_repository_request.commit_id,
request.state.user_id,
)
else:
repository = await repository_service.get_repository_by_url_and_commit_id(
upload_repository_request.https_url, commit_id=upload_repository_request.commit_id
)

# If the repository already exists, return its ID
if repository:
return Response(message="Repository already exists", data={"repository_id": repository.id})
# If the repository already exists, return its ID
if repository:
return Response(
message="Repository already exists", data={"repository_id": repository.id}
)

# Check if the number of repositories exceeds the limit
if settings.ENABLE_AUTHENTICATION:
Expand Down
6 changes: 3 additions & 3 deletions prometheus/tools/file_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class FileOperationTool:
read_file_spec = ToolSpec(
description="""\
Read the content of a file with line numbers prepended from the codebase with a safety limit on the number of lines.
Returns up to the first 1000 lines by default to prevent context issues with large files.
Returns up to the first 800 lines by default to prevent context issues with large files.
Returns an error message if the file doesn't exist.
""",
input_schema=ReadFileInput,
Expand Down Expand Up @@ -129,7 +129,7 @@ def __init__(self, root_path: str, kg: KnowledgeGraph):
self.root_path = root_path
self.kg = kg

def read_file(self, relative_path: str, n_lines: int = 1000) -> str:
def read_file(self, relative_path: str, n_lines: int = 800) -> str:
if os.path.isabs(relative_path):
return f"relative_path: {relative_path} is a absolute path, not relative path."

Expand Down Expand Up @@ -245,7 +245,7 @@ def read_file_with_knowledge_graph_data(
with file_path.open() as f:
lines = f.readlines()
# Limit to first 1000 lines to avoid context issues
selected_text_with_line_numbers = pre_append_line_numbers("".join(lines[:1000]), 1)
selected_text_with_line_numbers = pre_append_line_numbers("".join(lines[:800]), 1)

result_data = [
{
Expand Down