Skip to content

Commit

Permalink
Merge pull request #363 from Pythagora-io/only-replace-things-in-stri…
Browse files Browse the repository at this point in the history
…ng-files

Only send text files to the LLM
  • Loading branch information
LeonOstrez authored Dec 18, 2023
2 parents 827519a + a7c1bb8 commit 2e651c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pilot/helpers/Project.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ def get_all_coded_files(self):

files = self.get_files([file.path + '/' + file.name for file in files])

# Don't send contents of binary files
for file in files:
if not isinstance(file["content"], str):
file["content"] = f"<<binary file, {len(file['content'])} bytes>>"

# TODO temoprary fix to eliminate files that are not in the project
files = [file for file in files if file['content'] != '']
# TODO END
Expand Down
3 changes: 3 additions & 0 deletions pilot/helpers/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import platform
from unittest.mock import patch, MagicMock, call

import pytest

from helpers.cli import execute_command, terminate_process, run_command_until_success
from helpers.test_Project import create_project

@pytest.mark.xfail()
@patch("helpers.cli.os")
@patch("helpers.cli.subprocess")
def test_terminate_process_not_running(mock_subprocess, mock_os):
Expand Down

0 comments on commit 2e651c4

Please sign in to comment.