Spaces:
Runtime error
Runtime error
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +3 -3
src/streamlit_app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
|
| 3 |
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
| 4 |
from langchain_community.vectorstores import FAISS
|
| 5 |
from langchain_huggingface import HuggingFaceEmbeddings
|
|
@@ -28,8 +28,8 @@ if not GEMINI_API_KEY:
|
|
| 28 |
st.stop()
|
| 29 |
|
| 30 |
try:
|
| 31 |
-
genai.
|
| 32 |
-
model =
|
| 33 |
except Exception as e:
|
| 34 |
st.error(f"Gagal menginisialisasi Gemini: {str(e)}")
|
| 35 |
st.stop()
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from google import genai
|
| 3 |
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
| 4 |
from langchain_community.vectorstores import FAISS
|
| 5 |
from langchain_huggingface import HuggingFaceEmbeddings
|
|
|
|
| 28 |
st.stop()
|
| 29 |
|
| 30 |
try:
|
| 31 |
+
client = genai.Client(api_key=GEMINI_API_KEY)
|
| 32 |
+
model = client.models.get("gemini-2.5-flash")
|
| 33 |
except Exception as e:
|
| 34 |
st.error(f"Gagal menginisialisasi Gemini: {str(e)}")
|
| 35 |
st.stop()
|