Skip to content

Commit 1a1e428

Browse files
committed
Add MODEL_NAME envvar
1 parent 45cbfaa commit 1a1e428

File tree

1 file changed

+4
-2
lines changed
  • instrumentation-genai/opentelemetry-instrumentation-vertexai/examples/langgraph-chatbot-demo/src/langgraph_chatbot_demo

1 file changed

+4
-2
lines changed

instrumentation-genai/opentelemetry-instrumentation-vertexai/examples/langgraph-chatbot-demo/src/langgraph_chatbot_demo/langchain_history.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Adapted from https://github.com/langchain-ai/streamlit-agent/blob/main/streamlit_agent/basic_memory.py"""
22

33
import logging
4+
import os
45
import sqlite3
56
import tempfile
67
from random import getrandbits
@@ -25,6 +26,8 @@
2526
from opentelemetry import trace
2627
from opentelemetry.trace.span import format_trace_id
2728

29+
MODEL_NAME = os.environ.get("MODEL_NAME", "gemini-2.0-flash")
30+
2831
logger = logging.getLogger(__name__)
2932
logger.setLevel(logging.DEBUG)
3033

@@ -43,8 +46,7 @@
4346
st.title(title)
4447
_streamlit_helpers.styles()
4548

46-
47-
model = PatchedChatVertexAI(model="gemini-2.0-flash")
49+
model = PatchedChatVertexAI(model=MODEL_NAME)
4850

4951
if not st.query_params.get("thread_id"):
5052
result = model.invoke(

0 commit comments

Comments
 (0)