Spaces:
Sleeping
Sleeping
Portfolio User
commited on
Commit
·
4db4d38
1
Parent(s):
98f062f
Switch to Gemini 3 Flash model
Browse files- agent/core.py +2 -2
- app.py +1 -1
- check_models.py +14 -0
agent/core.py
CHANGED
|
@@ -12,9 +12,9 @@ class MedicalAgent:
|
|
| 12 |
|
| 13 |
genai.configure(api_key=self.api_key)
|
| 14 |
|
| 15 |
-
# Using Gemini
|
| 16 |
self.model = genai.GenerativeModel(
|
| 17 |
-
model_name="gemini-
|
| 18 |
system_instruction=(
|
| 19 |
"You are an advanced Medical AI Assistant. Your goal is to provide accurate, "
|
| 20 |
"helpful, and empathetic medical information based on available datasets. "
|
|
|
|
| 12 |
|
| 13 |
genai.configure(api_key=self.api_key)
|
| 14 |
|
| 15 |
+
# Using Gemini 3 Flash (Latest free version in 2026)
|
| 16 |
self.model = genai.GenerativeModel(
|
| 17 |
+
model_name="gemini-3-flash-preview",
|
| 18 |
system_instruction=(
|
| 19 |
"You are an advanced Medical AI Assistant. Your goal is to provide accurate, "
|
| 20 |
"helpful, and empathetic medical information based on available datasets. "
|
app.py
CHANGED
|
@@ -46,7 +46,7 @@ with gr.Blocks(theme=theme, title="Medical AI Agent") as demo:
|
|
| 46 |
# 🏥 Medical AI Assistant
|
| 47 |
Developed by **[shahnewazkabirrafi017-hub](https://github.com/shahnewazkabirrafi017-hub)**
|
| 48 |
|
| 49 |
-
This agent is grounded in the **OpenMed** dataset collection and powered by **Gemini
|
| 50 |
|
| 51 |
*⚠️ Disclaimer: This is an AI tool for educational purposes. Consult a doctor for medical advice.*
|
| 52 |
"""
|
|
|
|
| 46 |
# 🏥 Medical AI Assistant
|
| 47 |
Developed by **[shahnewazkabirrafi017-hub](https://github.com/shahnewazkabirrafi017-hub)**
|
| 48 |
|
| 49 |
+
This agent is grounded in the **OpenMed** dataset collection and powered by **Gemini 3 Flash**.
|
| 50 |
|
| 51 |
*⚠️ Disclaimer: This is an AI tool for educational purposes. Consult a doctor for medical advice.*
|
| 52 |
"""
|
check_models.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import google.generativeai as genai
|
| 2 |
+
import os
|
| 3 |
+
from dotenv import load_dotenv
|
| 4 |
+
|
| 5 |
+
load_dotenv()
|
| 6 |
+
genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
|
| 7 |
+
|
| 8 |
+
print("Listing supported models...")
|
| 9 |
+
try:
|
| 10 |
+
for m in genai.list_models():
|
| 11 |
+
if 'generateContent' in m.supported_generation_methods:
|
| 12 |
+
print(m.name)
|
| 13 |
+
except Exception as e:
|
| 14 |
+
print(f"Error: {e}")
|