Skip to content

Commit 44c50e9

Browse files
committed
Alwrity - Bug fixes
1 parent bdab2e9 commit 44c50e9

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

lib/ai_web_researcher/gpt_online_researcher.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def gpt_web_researcher(search_keywords):
4646
""" Keyword based web researcher, basic, neural and Semantic search."""
4747

4848
# TBD: Keeping the results directory as fixed, for now.
49-
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"))
49+
os.environ["SEARCH_SAVE_FILE"] = os.path.join(os.getcwd(), "workspace",
50+
search_keywords.replace(" ", "_") + "_" + datetime.now().strftime("%Y-%m-%d_%H-%M-%S"))
5051

5152
try:
5253
google_search_result = do_google_serp_search(search_keywords)

lib/gpt_providers/text_generation/main_text_generation.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,11 @@ def check_gpt_provider(gpt_provider):
6969
ValueError: If both the specified GPT provider and environment variable GPT_PROVIDER are missing.
7070
"""
7171
env_gpt_provider = os.getenv('GPT_PROVIDER')
72-
73-
if gpt_provider:
74-
os.environ['GPT_PROVIDER'] = gpt_provider
75-
elif env_gpt_provider:
72+
if gpt_provider and if gpt_provider != env_gpt_provider:
73+
logger.warning(f"Config: '{gpt_provider}' different to environment variable 'GPT_PROVIDER' '{env_gpt_provider}'")
74+
logger.info(f"Using Environment GPT provider: {env_gpt_provider}")
7675
gpt_provider = env_gpt_provider
77-
else:
78-
raise ValueError("Both specified GPT provider and environment variable 'GPT_PROVIDER' are missing.")
7976

80-
if gpt_provider != env_gpt_provider:
81-
logger.warning(f"Config: '{gpt_provider}' different to environment variable 'GPT_PROVIDER' '{env_gpt_provider}'")
82-
logger.info(f"Using GPT provider: {gpt_provider}")
8377
return gpt_provider
8478

8579

0 commit comments

Comments
 (0)