Alwrity - Bug fixes
This commit is contained in:
@@ -46,7 +46,8 @@ def gpt_web_researcher(search_keywords):
|
|||||||
""" Keyword based web researcher, basic, neural and Semantic search."""
|
""" Keyword based web researcher, basic, neural and Semantic search."""
|
||||||
|
|
||||||
# TBD: Keeping the results directory as fixed, for now.
|
# 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:
|
try:
|
||||||
google_search_result = do_google_serp_search(search_keywords)
|
google_search_result = do_google_serp_search(search_keywords)
|
||||||
|
|||||||
@@ -69,17 +69,11 @@ def check_gpt_provider(gpt_provider):
|
|||||||
ValueError: If both the specified GPT provider and environment variable GPT_PROVIDER are missing.
|
ValueError: If both the specified GPT provider and environment variable GPT_PROVIDER are missing.
|
||||||
"""
|
"""
|
||||||
env_gpt_provider = os.getenv('GPT_PROVIDER')
|
env_gpt_provider = os.getenv('GPT_PROVIDER')
|
||||||
|
if gpt_provider and if gpt_provider != env_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:
|
|
||||||
logger.warning(f"Config: '{gpt_provider}' different to environment variable '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
|
return gpt_provider
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user