mirror of
https://github.com/lfnovo/open-notebook.git
synced 2026-04-30 20:39:55 +00:00
temporary fix to config cache
This commit is contained in:
parent
cc9b0ac68c
commit
b89250d3ca
18 changed files with 664 additions and 587 deletions
|
|
@ -1,14 +1,15 @@
|
|||
import os
|
||||
|
||||
from langchain_core.runnables import (
|
||||
RunnableConfig,
|
||||
)
|
||||
from langgraph.graph import END, START, StateGraph
|
||||
from typing_extensions import TypedDict
|
||||
|
||||
from open_notebook.config import load_default_models
|
||||
from open_notebook.domain.notebook import Note, Notebook, Source
|
||||
from open_notebook.graphs.utils import run_pattern
|
||||
|
||||
DEFAULT_MODELS, EMBEDDING_MODEL, SPEECH_TO_TEXT_MODEL = load_default_models()
|
||||
|
||||
|
||||
class DocQueryState(TypedDict):
|
||||
doc_id: str
|
||||
|
|
@ -20,7 +21,7 @@ class DocQueryState(TypedDict):
|
|||
|
||||
def call_model(state: dict, config: RunnableConfig) -> dict:
|
||||
model_id = config.get("configurable", {}).get(
|
||||
"model_id", os.environ.get("RETRIEVAL_MODEL")
|
||||
"model_id", DEFAULT_MODELS.default_transformation_model
|
||||
)
|
||||
return {"answer": run_pattern("doc_query", model_id, state)}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue