Spaces:
Running
Running
Asish Karthikeya Gogineni commited on
Commit ·
fe03c86
1
Parent(s): 8e40df0
fix: Use gemini-2.5-flash as default (confirmed working)
Browse files- app.py +6 -8
- code_chatbot/rag.py +5 -4
app.py
CHANGED
|
@@ -331,16 +331,14 @@ with st.sidebar:
|
|
| 331 |
gemini_model = st.selectbox(
|
| 332 |
"Gemini Model",
|
| 333 |
[
|
| 334 |
-
"gemini-
|
| 335 |
-
"gemini-1.5-pro",
|
| 336 |
"gemini-2.0-flash",
|
| 337 |
-
"gemini-
|
| 338 |
],
|
| 339 |
-
index=0, # Default to
|
| 340 |
-
help="""**Gemini
|
| 341 |
-
**Gemini
|
| 342 |
-
**Gemini
|
| 343 |
-
**Gemini 2.5 Flash**: Latest, may require paid plan"""
|
| 344 |
)
|
| 345 |
st.caption(f"✨ Using {gemini_model}")
|
| 346 |
|
|
|
|
| 331 |
gemini_model = st.selectbox(
|
| 332 |
"Gemini Model",
|
| 333 |
[
|
| 334 |
+
"gemini-2.5-flash", # This one was working!
|
|
|
|
| 335 |
"gemini-2.0-flash",
|
| 336 |
+
"gemini-1.5-pro",
|
| 337 |
],
|
| 338 |
+
index=0, # Default to 2.5 Flash (confirmed working)
|
| 339 |
+
help="""**Gemini 2.5 Flash** (Recommended): Latest, confirmed working
|
| 340 |
+
**Gemini 2.0 Flash**: Newer model
|
| 341 |
+
**Gemini 1.5 Pro**: More stable for complex tasks"""
|
|
|
|
| 342 |
)
|
| 343 |
st.caption(f"✨ Using {gemini_model}")
|
| 344 |
|
code_chatbot/rag.py
CHANGED
|
@@ -118,10 +118,11 @@ class ChatEngine:
|
|
| 118 |
if not os.getenv("GOOGLE_API_KEY"):
|
| 119 |
raise ValueError("Google API Key is required for Gemini")
|
| 120 |
|
| 121 |
-
# Use
|
| 122 |
-
model_name = self.model_name or "gemini-
|
| 123 |
-
if
|
| 124 |
-
|
|
|
|
| 125 |
|
| 126 |
return ChatGoogleGenerativeAI(
|
| 127 |
model=model_name,
|
|
|
|
| 118 |
if not os.getenv("GOOGLE_API_KEY"):
|
| 119 |
raise ValueError("Google API Key is required for Gemini")
|
| 120 |
|
| 121 |
+
# Use model name without prefix - langchain handles it
|
| 122 |
+
model_name = self.model_name or "gemini-2.5-flash"
|
| 123 |
+
# Remove models/ prefix if present (langchain adds it)
|
| 124 |
+
if model_name.startswith("models/"):
|
| 125 |
+
model_name = model_name.replace("models/", "")
|
| 126 |
|
| 127 |
return ChatGoogleGenerativeAI(
|
| 128 |
model=model_name,
|