VicMata commited on
Commit
17faa20
·
verified ·
1 Parent(s): 24990fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -32
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
- def generate():
8
- client = genai.Client(
9
- api_key=os.environ.get("AIzaSyBDfb85vueYjLTGvArrgBsAYF4d8u6LfuU"),
10
- )
11
 
12
- model = "gemini-2.5-pro-exp-03-25"
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
- for chunk in client.models.generate_content_stream(
30
- model=model,
31
- contents=contents,
32
- config=generate_content_config,
33
- ):
34
- print(chunk.text, end="")
35
 
36
- if __name__ == "__main__":
37
- generate()
 
 
 
 
 
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)