This commit is contained in:
6
main.py
6
main.py
@@ -209,7 +209,7 @@ def extract_text_from_url(url, timeout=10, verify=True):
|
||||
def gpt_response_message(content: str, name_promt: str):
|
||||
|
||||
contentGPT = wp.get_promt(name_promt).replace('{content}', content)
|
||||
|
||||
print(contentGPT)
|
||||
url = 'http://45.129.78.228:8484' #10.8.0.14:5500
|
||||
params = {'text': contentGPT}
|
||||
|
||||
@@ -336,7 +336,7 @@ def start_pars_one_istochnik(data_init=""):
|
||||
print(f"Страница {page_number} [{i}/{len(hrefs)}] parsing {link}")
|
||||
text = extract_text_from_url_one(link)
|
||||
if len(text) >= 100:
|
||||
response_text = gpt_response_message(text, url_ist = "source1")
|
||||
response_text = gpt_response_message(text, "source1")
|
||||
print(response_text)
|
||||
if response_text:
|
||||
update_bd_and_create_document(response_text=response_text, article_date=f"{current_year}/{current_month}/{current_day}", url=link, parsed_at=str(dt.now()), original_text=text, other=url)
|
||||
@@ -364,7 +364,7 @@ def start_pars_two_istochnik():
|
||||
try:
|
||||
text, time_text = extract_text_from_url(hrefs)
|
||||
if len(text) >= 100:
|
||||
response_text = gpt_response_message(text, url_ist = "source2")
|
||||
response_text = gpt_response_message(text, "source2")
|
||||
print(response_text)
|
||||
if response_text:
|
||||
update_bd_and_create_document(response_text=response_text, article_date=time_text, url=hrefs, parsed_at=str(dt.now()), original_text=text, other=url)
|
||||
|
||||
Reference in New Issue
Block a user