mirror of
https://github.com/lfnovo/open-notebook.git
synced 2026-04-29 12:00:00 +00:00
implement model config
This commit is contained in:
parent
63a568490e
commit
8bb5db158f
19 changed files with 434 additions and 105 deletions
|
|
@ -9,8 +9,8 @@ from langgraph.graph import END, START, StateGraph
|
|||
from langgraph.graph.message import add_messages
|
||||
from typing_extensions import TypedDict
|
||||
|
||||
from open_notebook.config import LANGGRAPH_CHECKPOINT_FILE
|
||||
from open_notebook.domain import Notebook
|
||||
from open_notebook.config import DEFAULT_MODELS, LANGGRAPH_CHECKPOINT_FILE
|
||||
from open_notebook.domain.notebook import Notebook
|
||||
from open_notebook.graphs.utils import run_pattern
|
||||
|
||||
|
||||
|
|
@ -22,7 +22,9 @@ class ThreadState(TypedDict):
|
|||
|
||||
|
||||
def call_model_with_messages(state: ThreadState, config: RunnableConfig) -> dict:
|
||||
model_name = config.get("configurable", {}).get("model_name", None)
|
||||
model_name = config.get("configurable", {}).get(
|
||||
"model_name", DEFAULT_MODELS.default_chat_model
|
||||
)
|
||||
ai_message = run_pattern(
|
||||
"chat",
|
||||
model_name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue