diff --git a/open_notebook/graphs/utils.py b/open_notebook/graphs/utils.py index 4ed3000..39871ee 100644 --- a/open_notebook/graphs/utils.py +++ b/open_notebook/graphs/utils.py @@ -21,11 +21,6 @@ def run_pattern( DEFAULT_MODELS, EMBEDDING_MODEL, SPEECH_TO_TEXT_MODEL = load_default_models() tokens = token_count(str(system_prompt) + str(messages)) - model_id = ( - DEFAULT_MODELS.large_context_model - or DEFAULT_MODELS.default_transformation_model - or DEFAULT_MODELS.default_chat_model - ) if tokens > 105_000: model_id = DEFAULT_MODELS.large_context_model logger.debug( diff --git a/pages/8_🛝_Playground.py b/pages/8_🛝_Playground.py index a041847..53de8f9 100644 --- a/pages/8_🛝_Playground.py +++ b/pages/8_🛝_Playground.py @@ -1,6 +1,7 @@ import streamlit as st import yaml +from open_notebook.domain.models import Model from open_notebook.graphs.multipattern import graph as pattern_graph from stream_app.utils import version_sidebar @@ -24,6 +25,12 @@ transformation = st.selectbox( with st.expander("Details"): st.json(transformation) +models = Model.get_models_by_type("language") +model = st.selectbox( + "Pick a pattern model", + models, + format_func=lambda x: x.name, +) input_text = st.text_area("Enter some text", height=200) if st.button("Run"): @@ -31,6 +38,7 @@ if st.button("Run"): dict( content_stack=[input_text], patterns=transformation["patterns"], - ) + ), + config=dict(configurable={"model_id": model.id}), ) st.markdown(output["output"])