|
|
@@ -10,11 +10,12 @@ from data_models.content_chunks import ContentChunks
|
|
|
from data_models.keyword_clustering import KeywordClustering
|
|
|
from data_models.keyword_data import KeywordData
|
|
|
from data_models.keyword_with_content_chunk import KeywordWithContentChunk
|
|
|
-from utils.deepseek_utils import get_keyword_summary, update_keyword_summary_prompt
|
|
|
+from utils.deepseek_utils import get_keyword_summary, update_keyword_summary
|
|
|
|
|
|
|
|
|
class KeywordSummaryTask:
|
|
|
lock_dict = {} # 静态变量,不会随着每次实例化而重置
|
|
|
+
|
|
|
def __init__(self):
|
|
|
self.executor = ThreadPoolExecutor(max_workers=20, thread_name_prefix='KeywordSummaryTask')
|
|
|
|
|
|
@@ -56,9 +57,9 @@ class KeywordSummaryTask:
|
|
|
'keyword_summary'])
|
|
|
db_helper.add(new_keyword_clustering)
|
|
|
else:
|
|
|
- new_keyword_summary = update_keyword_summary_prompt(keyword_clustering.keyword_summary,
|
|
|
- keyword,
|
|
|
- content_chunk.text)
|
|
|
+ new_keyword_summary = update_keyword_summary(keyword_clustering.keyword_summary,
|
|
|
+ keyword,
|
|
|
+ content_chunk.text)
|
|
|
db_helper.update(KeywordClustering, filters={"id": keyword_clustering.id},
|
|
|
updates={"keyword_summary": new_keyword_summary})
|
|
|
db_helper.update(KeywordWithContentChunk, filters={"id": keyword_with_content_chunk.id},
|