Encoding utf-8, bug fix
This commit is contained in:
@@ -334,7 +334,7 @@ def check_llm_environs():
|
|||||||
api_key = typer.prompt(f"\n🙆🙆Please enter {api_key_var} API Key:")
|
api_key = typer.prompt(f"\n🙆🙆Please enter {api_key_var} API Key:")
|
||||||
|
|
||||||
# Update .env file
|
# Update .env file
|
||||||
with open(".env", "a") as env_file:
|
with open(".env", "a", encoding="utf-8") as env_file:
|
||||||
env_file.write(f"GPT_PROVIDER={gpt_provider.lower()}\n")
|
env_file.write(f"GPT_PROVIDER={gpt_provider.lower()}\n")
|
||||||
env_file.write(f"{api_key_var}={api_key}\n")
|
env_file.write(f"{api_key_var}={api_key}\n")
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ def cfg_search_param(flag):
|
|||||||
file_path = Path(__file__).resolve().parents[2] / "main_config"
|
file_path = Path(__file__).resolve().parents[2] / "main_config"
|
||||||
logger.info(f"Reading search config params from {file_path}")
|
logger.info(f"Reading search config params from {file_path}")
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read(file_path)
|
config.read(file_path, encoding="utf-8")
|
||||||
web_research_section = config["web_research"]
|
web_research_section = config["web_research"]
|
||||||
|
|
||||||
if 'serperdev' in flag:
|
if 'serperdev' in flag:
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ def blog_proof_editor(blog_content):
|
|||||||
config_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'main_config'))
|
config_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'main_config'))
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
#config = configparser.RawConfigParser()
|
#config = configparser.RawConfigParser()
|
||||||
config.read(config_path, encoding='utf-8-sig')
|
config.read(config_path, encoding='utf-8')
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
print(f"ProofReader: Failed to read values from config: {err}")
|
print(f"ProofReader: Failed to read values from config: {err}")
|
||||||
|
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ def read_llm_parameters(config_path: str) -> tuple:
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read(config_path)
|
config.read(config_path, encoding="utf-8")
|
||||||
|
|
||||||
gpt_provider = config.get('llm_options', 'gpt_provider')
|
gpt_provider = config.get('llm_options', 'gpt_provider')
|
||||||
model = config.get('llm_options', 'model')
|
model = config.get('llm_options', 'model')
|
||||||
|
|||||||
Reference in New Issue
Block a user