Skip to content

Commit

Permalink
Fix flake8 W293 and W391
Browse files Browse the repository at this point in the history
  • Loading branch information
nponeccop committed Apr 11, 2023
1 parent 5a6e565 commit d12da33
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion scripts/ai_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,3 @@ def construct_full_prompt(self) -> str:

full_prompt += f"\n\n{data.load_prompt()}"
return full_prompt

2 changes: 1 addition & 1 deletion scripts/browse.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def scrape_text(url):
# Most basic check if the URL is valid:
if not url.startswith('http'):
return "Error: Invalid URL"

# Restrict access to local files
if check_local_file_access(url):
return "Error: Access to local files is restricted"
Expand Down
4 changes: 2 additions & 2 deletions scripts/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ def chat_with_ai(
"""
model = cfg.fast_llm_model # TODO: Change model from hardcode to argument
# Reserve 1000 tokens for the response

if cfg.debug:
print(f"Token limit: {token_limit}")

send_token_limit = token_limit - 1000

relevant_memory = permanent_memory.get_relevant(str(full_message_history[-5:]), 10)
Expand Down
6 changes: 3 additions & 3 deletions scripts/json_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ def fix_and_parse_json(
return json_str
else:
raise e


def fix_json(json_str: str, schema: str) -> str:
"""Fix the given JSON string to make it parseable and fully complient with the provided schema."""

# Try to fix the JSON using gpt:
function_string = "def fix_json(json_str: str, schema:str=None) -> str:"
args = [f"'''{json_str}'''", f"'''{schema}'''"]
Expand Down
1 change: 0 additions & 1 deletion scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,4 +415,3 @@ def parse_arguments():
chat.create_chat_message(
"system", "Unable to execute command"))
print_to_console("SYSTEM: ", Fore.YELLOW, "Unable to execute command")

0 comments on commit d12da33

Please sign in to comment.