Update to Gemini 2.5 Pro and add model indicator in chat
This commit is contained in:
parent
992640f8ea
commit
3932b5b139
3 changed files with 13 additions and 8 deletions
|
|
@ -29,7 +29,7 @@ def get_llm_by_type(model_type: str = 'openai'):
|
|||
raise ValueError("GOOGLE_API_KEY not found in environment")
|
||||
|
||||
return Gemini(
|
||||
model="models/gemini-2.0-flash-exp",
|
||||
model="models/gemini-2.5-pro-latest",
|
||||
api_key=api_key,
|
||||
temperature=0.7
|
||||
)
|
||||
|
|
@ -66,7 +66,7 @@ def get_model_display_name(model_type: str) -> str:
|
|||
"""Get user-friendly model name"""
|
||||
names = {
|
||||
'openai': 'OpenAI GPT-4',
|
||||
'gemini': 'Google Gemini 2.0 Flash'
|
||||
'gemini': 'Google Gemini 2.5 Pro'
|
||||
}
|
||||
return names.get(model_type, 'Unknown Model')
|
||||
|
||||
|
|
@ -88,9 +88,9 @@ MODEL_COSTS = {
|
|||
'description': 'GPT-4 - Most capable, highest quality'
|
||||
},
|
||||
'gemini': {
|
||||
'input': 0.0, # Free tier available
|
||||
'output': 0.0, # Free tier available
|
||||
'description': 'Gemini 2.0 Flash - Fast, cost-effective'
|
||||
'input': 1.25, # $1.25 per 1M tokens
|
||||
'output': 5.0, # $5.00 per 1M tokens
|
||||
'description': 'Gemini 2.5 Pro - Latest, most capable, 80% cheaper than GPT-4'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,10 +97,10 @@ if st.session_state.get("creating_notebook"):
|
|||
model_choice = st.selectbox(
|
||||
"Choose AI Model:",
|
||||
options=['openai', 'gemini'],
|
||||
format_func=lambda x: "🤖 OpenAI GPT-4 (Most capable)" if x == 'openai' else "✨ Google Gemini 2.0 Flash (Fast & Free)",
|
||||
format_func=lambda x: "🤖 OpenAI GPT-4 (Most capable)" if x == 'openai' else "✨ Google Gemini 2.5 Pro (Latest, 80% cheaper)",
|
||||
help="Model used for chat, synthesis, and podcasts. Can't be changed after creation."
|
||||
)
|
||||
st.caption("💰 OpenAI: ~$0.03/1K tokens | Gemini: Free tier available")
|
||||
st.caption("💰 OpenAI: $30/1M input, $60/1M output | Gemini 2.5 Pro: $1.25/1M input, $5/1M output")
|
||||
|
||||
st.markdown("### Upload Documents (optional)")
|
||||
uploaded_files = st.file_uploader(
|
||||
|
|
|
|||
|
|
@ -295,7 +295,12 @@ with col_chat:
|
|||
for msg in messages
|
||||
]
|
||||
|
||||
st.caption(f"Chatting across {len(documents)} document(s) in this notebook only")
|
||||
# Show which model is being used
|
||||
from llm_factory import get_model_display_name, get_model_emoji
|
||||
model_name = get_model_display_name(notebook.model_type)
|
||||
model_emoji = get_model_emoji(notebook.model_type)
|
||||
|
||||
st.caption(f"{model_emoji} Using {model_name} | Chatting across {len(documents)} document(s)")
|
||||
st.markdown("---")
|
||||
|
||||
# Display chat messages
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue