Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,37 +1,15 @@
|
|
| 1 |
-
import base64
|
| 2 |
-
import os
|
| 3 |
-
from google import genai
|
| 4 |
-
from google.genai import types
|
| 5 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
-
client = genai.Client(
|
| 9 |
-
api_key=os.environ.get("AIzaSyBDfb85vueYjLTGvArrgBsAYF4d8u6LfuU"),
|
| 10 |
-
)
|
| 11 |
|
| 12 |
-
|
| 13 |
-
contents = [
|
| 14 |
-
types.Content(
|
| 15 |
-
role="user",
|
| 16 |
-
parts=[
|
| 17 |
-
types.Part.from_text(text="""INSERT_INPUT_HERE"""),
|
| 18 |
-
],
|
| 19 |
-
),
|
| 20 |
-
]
|
| 21 |
-
generate_content_config = types.GenerateContentConfig(
|
| 22 |
-
temperature=1,
|
| 23 |
-
top_p=0.95,
|
| 24 |
-
top_k=64,
|
| 25 |
-
max_output_tokens=65536,
|
| 26 |
-
response_mime_type="text/plain",
|
| 27 |
-
)
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
contents=contents,
|
| 32 |
-
config=generate_content_config,
|
| 33 |
-
):
|
| 34 |
-
print(chunk.text, end="")
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import os
|
| 3 |
+
from google.generativeai as genai
|
| 4 |
+
from dotenv import load_dotenv
|
| 5 |
+
import fitz
|
| 6 |
|
| 7 |
+
load_dotenv()
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
GEMINI_API_KEY = os.environ["GEMINI_API_KEY"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
st.title("Gemini chatbot")
|
| 12 |
+
st.subheader("Hola, hazle una pregunta a Gemini :)")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
prompt = st.text_input("Escribe tu prompt aquí")
|
| 15 |
+
st.write(prompt)
|