Spaces:
Running
Running
Update kig_core/processing.py
Browse files- kig_core/processing.py +2 -2
kig_core/processing.py
CHANGED
@@ -3,7 +3,7 @@ from typing import List, Dict, Any, Union, Optional
|
|
3 |
from langchain_core.output_parsers import StrOutputParser
|
4 |
|
5 |
from .config import settings
|
6 |
-
from .llm_interface import get_llm
|
7 |
from .prompts import SUMMARIZER_PROMPT
|
8 |
from .graph_operations import format_doc_for_llm # Reuse formatting
|
9 |
|
@@ -55,7 +55,7 @@ def summarize_document(doc_content: str) -> str:
|
|
55 |
try:
|
56 |
summarize_llm = get_llm(settings.summarize_llm_model)
|
57 |
summarize_chain = SUMMARIZER_PROMPT | summarize_llm | StrOutputParser()
|
58 |
-
summary = summarize_chain
|
59 |
logger.debug("Summarization complete.")
|
60 |
return summary
|
61 |
except Exception as e:
|
|
|
3 |
from langchain_core.output_parsers import StrOutputParser
|
4 |
|
5 |
from .config import settings
|
6 |
+
from .llm_interface import get_llm, invoke_llm
|
7 |
from .prompts import SUMMARIZER_PROMPT
|
8 |
from .graph_operations import format_doc_for_llm # Reuse formatting
|
9 |
|
|
|
55 |
try:
|
56 |
summarize_llm = get_llm(settings.summarize_llm_model)
|
57 |
summarize_chain = SUMMARIZER_PROMPT | summarize_llm | StrOutputParser()
|
58 |
+
summary = invoke_llm(summarize_chain, {"document": doc_content})
|
59 |
logger.debug("Summarization complete.")
|
60 |
return summary
|
61 |
except Exception as e:
|