Skip to content

Commit

Permalink
Remove trailing whitespace throughout
Browse files Browse the repository at this point in the history
  • Loading branch information
nponeccop committed Apr 10, 2023
1 parent 4d42e14 commit c9701a3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions scripts/ai_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def __init__(self, ai_name: str="", ai_role: str="", ai_goals: list=[]) -> None:
@classmethod
def load(cls: object, config_file: str=SAVE_FILE) -> object:
"""
Returns class object with parameters (ai_name, ai_role, ai_goals) loaded from yaml file if yaml file exists,
Returns class object with parameters (ai_name, ai_role, ai_goals) loaded from yaml file if yaml file exists,
else returns class with no parameters.
Parameters:
cls (class object): An AIConfig Class object.
config_file (int): The path to the config yaml file. DEFAULT: "../ai_settings.yaml"
Returns:
cls (object): A instance of given cls object
cls (object): A instance of given cls object
"""

try:
Expand All @@ -61,11 +61,11 @@ def save(self, config_file: str=SAVE_FILE) -> None:
"""
Saves the class parameters to the specified file yaml file path as a yaml file.
Parameters:
Parameters:
config_file(str): The path to the config yaml file. DEFAULT: "../ai_settings.yaml"
Returns:
None
None
"""

config = {"ai_name": self.ai_name, "ai_role": self.ai_role, "ai_goals": self.ai_goals}
Expand All @@ -76,7 +76,7 @@ def construct_full_prompt(self) -> str:
"""
Returns a prompt to the user with the class information in an organized fashion.
Parameters:
Parameters:
None
Returns:
Expand Down
2 changes: 1 addition & 1 deletion scripts/ai_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def evaluate_code(code: str) -> List[str]:

def improve_code(suggestions: List[str], code: str) -> str:
"""
A function that takes in code and suggestions and returns a response from create chat completion api call.
A function that takes in code and suggestions and returns a response from create chat completion api call.
Parameters:
suggestions (List): A list of suggestions around what needs to be improved.
Expand Down
2 changes: 1 addition & 1 deletion scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self):
self.continuous_mode = False
self.speak_mode = False

self.fast_llm_model = os.getenv("FAST_LLM_MODEL", "gpt-3.5-turbo")
self.fast_llm_model = os.getenv("FAST_LLM_MODEL", "gpt-3.5-turbo")
self.smart_llm_model = os.getenv("SMART_LLM_MODEL", "gpt-4")
self.fast_token_limit = int(os.getenv("FAST_TOKEN_LIMIT", 4000))
self.smart_token_limit = int(os.getenv("SMART_TOKEN_LIMIT", 8000))
Expand Down
2 changes: 1 addition & 1 deletion scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def parse_arguments():

if args.debug:
print_to_console("Debug Mode: ", Fore.GREEN, "ENABLED")
cfg.set_debug_mode(True)
cfg.set_debug_mode(True)

if args.gpt3only:
print_to_console("GPT3.5 Only Mode: ", Fore.GREEN, "ENABLED")
Expand Down
12 changes: 6 additions & 6 deletions tests/test_browse_scrape_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

class TestScrapeText:

# Tests that scrape_text() returns the expected text when given a valid URL.
# Tests that scrape_text() returns the expected text when given a valid URL.
def test_scrape_text_with_valid_url(self, mocker):
# Mock the requests.get() method to return a response with expected text
expected_text = "This is some sample text"
Expand All @@ -50,7 +50,7 @@ def test_scrape_text_with_valid_url(self, mocker):
url = "http://www.example.com"
assert scrape_text(url) == expected_text

# Tests that the function returns an error message when an invalid or unreachable url is provided.
# Tests that the function returns an error message when an invalid or unreachable url is provided.
def test_invalid_url(self, mocker):
# Mock the requests.get() method to raise an exception
mocker.patch("requests.get", side_effect=requests.exceptions.RequestException)
Expand All @@ -60,7 +60,7 @@ def test_invalid_url(self, mocker):
error_message = scrape_text(url)
assert "Error:" in error_message

# Tests that the function returns an empty string when the html page contains no text to be scraped.
# Tests that the function returns an empty string when the html page contains no text to be scraped.
def test_no_text(self, mocker):
# Mock the requests.get() method to return a response with no text
mock_response = mocker.Mock()
Expand All @@ -72,7 +72,7 @@ def test_no_text(self, mocker):
url = "http://www.example.com"
assert scrape_text(url) == ""

# Tests that the function returns an error message when the response status code is an http error (>=400).
# Tests that the function returns an error message when the response status code is an http error (>=400).
def test_http_error(self, mocker):
# Mock the requests.get() method to return a response with a 404 status code
mocker.patch('requests.get', return_value=mocker.Mock(status_code=404))
Expand All @@ -83,7 +83,7 @@ def test_http_error(self, mocker):
# Check that the function returns an error message
assert result == "Error: HTTP 404 error"

# Tests that scrape_text() properly handles HTML tags.
# Tests that scrape_text() properly handles HTML tags.
def test_scrape_text_with_html_tags(self, mocker):
# Create a mock response object with HTML containing tags
html = "<html><body><p>This is <b>bold</b> text.</p></body></html>"
Expand All @@ -96,4 +96,4 @@ def test_scrape_text_with_html_tags(self, mocker):
result = scrape_text("https://www.example.com")

# Check that the function properly handles HTML tags
assert result == "This is bold text."
assert result == "This is bold text."

0 comments on commit c9701a3

Please sign in to comment.