Try Competitor Analysis
This commit is contained in:
@@ -10,7 +10,7 @@ logger.add(sys.stdout,
|
||||
from ..gpt_providers.text_generation.main_text_generation import llm_text_gen
|
||||
|
||||
|
||||
def summarize_competitor_content(research_content, gpt_providers="openai"):
|
||||
def summarize_competitor_content(research_content):
|
||||
"""Combine the given online research and gpt blog content"""
|
||||
|
||||
prompt = f"""You are a helpful assistant writing a research report about a company. I will provide you with company details.
|
||||
@@ -23,7 +23,7 @@ def summarize_competitor_content(research_content, gpt_providers="openai"):
|
||||
Company details: '{research_content}'"""
|
||||
|
||||
try:
|
||||
response = gemini_text_response(prompt)
|
||||
response = llm_text_gen(prompt)
|
||||
return response
|
||||
except Exception as err:
|
||||
logger.error(f"Failed to get response from LLM: {err}")
|
||||
|
||||
@@ -80,7 +80,7 @@ def metaphor_find_similar(similar_url):
|
||||
search_response = metaphor.search_and_contents(
|
||||
acompetitor.url,
|
||||
type="keyword",
|
||||
num_results=5
|
||||
num_results=3
|
||||
)
|
||||
except Exception as err:
|
||||
logger.error(f"Failed to do metaphor keyword/url research: {err}")
|
||||
@@ -90,11 +90,10 @@ def metaphor_find_similar(similar_url):
|
||||
for r in tqdm(research_response, desc=f"{acompetitor.url}", unit="research"):
|
||||
all_contents += r.text
|
||||
try:
|
||||
acompetitor.text = summarize_competitor_content(all_contents, "gemini")
|
||||
acompetitor.text = summarize_competitor_content(all_contents)
|
||||
except Exception as err:
|
||||
logger.error(f"Failed to summarize_web_content: {err}")
|
||||
|
||||
print(competitors)
|
||||
print_search_result(competitors)
|
||||
return search_response
|
||||
|
||||
|
||||
Reference in New Issue
Block a user