Skip to content
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

Fix flake8 W293 and W391 #714

Merged
merged 1 commit into from
Apr 11, 2023
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
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")