- Add functionality to add a default dictionary for configuration fields
- Correct entitlement processing - Remove get_template functionality from ModelVariables, define it directly with LLM model definition in configuration file.
This commit is contained in:
@@ -12,13 +12,13 @@ from langchain_core.runnables import RunnablePassthrough
|
||||
from sqlalchemy import or_
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from common.extensions import db
|
||||
from common.extensions import db, cache_manager
|
||||
from common.models.document import DocumentVersion, Embedding, Document, Processor, Catalog
|
||||
from common.models.user import Tenant
|
||||
from common.utils.celery_utils import current_celery
|
||||
from common.utils.database import Database
|
||||
from common.utils.model_utils import create_language_template, get_model_variables, get_embedding_model_and_class, \
|
||||
get_embedding_llm
|
||||
get_embedding_llm, get_template
|
||||
|
||||
from common.utils.business_event import BusinessEvent
|
||||
from common.utils.business_event_context import current_event
|
||||
@@ -211,8 +211,8 @@ def enrich_chunks(tenant, model_variables, document_version, title, chunks):
|
||||
|
||||
def summarize_chunk(tenant, model_variables, document_version, chunk):
|
||||
current_event.log("Starting Summarizing Chunk")
|
||||
llm = get_embedding_llm()
|
||||
template = model_variables.get_template("summary")
|
||||
|
||||
template, llm = get_template("summary")
|
||||
language_template = create_language_template(template, document_version.language)
|
||||
summary_prompt = ChatPromptTemplate.from_template(language_template)
|
||||
setup = RunnablePassthrough()
|
||||
|
||||
Reference in New Issue
Block a user