Alwrity - Bug fixes

This commit is contained in:
AjaySi
2024-04-12 18:56:20 +05:30
parent bdab2e9959
commit 44c50e9ecd
2 changed files with 6 additions and 11 deletions

View File

@@ -46,7 +46,8 @@ def gpt_web_researcher(search_keywords):
""" Keyword based web researcher, basic, neural and Semantic search."""
# TBD: Keeping the results directory as fixed, for now.
os.environ["SEARCH_SAVE_FILE"] = os.path.join(os.getcwd(), "workspace", "web_research_reports", search_keywords.replace(" ", "_") + "_" + datetime.now().strftime("%Y-%m-%d_%H-%M-%S"))
os.environ["SEARCH_SAVE_FILE"] = os.path.join(os.getcwd(), "workspace",
search_keywords.replace(" ", "_") + "_" + datetime.now().strftime("%Y-%m-%d_%H-%M-%S"))
try:
google_search_result = do_google_serp_search(search_keywords)

View File

@@ -69,17 +69,11 @@ def check_gpt_provider(gpt_provider):
ValueError: If both the specified GPT provider and environment variable GPT_PROVIDER are missing.
"""
env_gpt_provider = os.getenv('GPT_PROVIDER')
if gpt_provider:
os.environ['GPT_PROVIDER'] = gpt_provider
elif env_gpt_provider:
gpt_provider = env_gpt_provider
else:
raise ValueError("Both specified GPT provider and environment variable 'GPT_PROVIDER' are missing.")
if gpt_provider != env_gpt_provider:
if gpt_provider and if gpt_provider != env_gpt_provider:
logger.warning(f"Config: '{gpt_provider}' different to environment variable 'GPT_PROVIDER' '{env_gpt_provider}'")
logger.info(f"Using GPT provider: {gpt_provider}")
logger.info(f"Using Environment GPT provider: {env_gpt_provider}")
gpt_provider = env_gpt_provider
return gpt_provider