Josedcape commited on
Commit
fed8ff8
verified
1 Parent(s): 8761383

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -16
app.py CHANGED
@@ -9,12 +9,20 @@ import tempfile
9
  from google.cloud import texttospeech
10
  from google.cloud.speech import SpeechClient, RecognitionAudio, RecognitionConfig
11
  from streamlit_webrtc import webrtc_streamer, WebRtcMode, AudioProcessorBase
 
 
12
 
13
  # Configuraci贸n de la clave API
14
  load_dotenv()
15
  openai.api_key = os.getenv("OPENAI_API_KEY")
16
  os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/your/google-cloud-credentials.json"
17
 
 
 
 
 
 
 
18
  # Clases para la gesti贸n de pedidos
19
  class PedidoAgent:
20
  def __init__(self, menu_csv_path):
@@ -174,7 +182,7 @@ st.markdown(
174
  )
175
 
176
  # Encabezado
177
- st.image("biblie.jpg")
178
  st.title("馃摉 LOS C脫DIGOS DE DIOS - BOTIDINAMIX AI")
179
  st.markdown("Bienvenido al Asistente Teol贸gico, donde puedes preguntar sobre interpretaciones y reflexiones b铆blicas.")
180
 
@@ -250,21 +258,6 @@ elif page == "Gesti贸n de Pedidos":
250
  calculo_pedido_agent.calcular_total(st.session_state)
251
 
252
  elif page == "Generador de Frases B铆blicas":
253
- import streamlit as st
254
- from dotenv import load_dotenv
255
- import os
256
- from vertexai import generative_models
257
- from vertexai.generative_models import GenerativeModel
258
-
259
- # Configuraci贸n de la clave API y la autenticaci贸n de Google Cloud
260
- load_dotenv()
261
- os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/your/google-cloud-credentials.json"
262
- GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")
263
- IMAGE_GENERATION_API_KEY = os.getenv("IMAGE_GENERATION_API_KEY")
264
-
265
- # Inicializaci贸n del modelo Gemini usando Vertex AI
266
- model = GenerativeModel(model_name="gemini-1.0-pro-vision")
267
-
268
  # Funci贸n para obtener una frase relacionada usando el modelo Gemini Advanced
269
  def obtener_frase_relacionada(versiculo):
270
  try:
 
9
  from google.cloud import texttospeech
10
  from google.cloud.speech import SpeechClient, RecognitionAudio, RecognitionConfig
11
  from streamlit_webrtc import webrtc_streamer, WebRtcMode, AudioProcessorBase
12
+ import vertexai
13
+ from vertexai.generative_models import GenerativeModel
14
 
15
  # Configuraci贸n de la clave API
16
  load_dotenv()
17
  openai.api_key = os.getenv("OPENAI_API_KEY")
18
  os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/your/google-cloud-credentials.json"
19
 
20
+ # Inicializaci贸n de Vertex AI
21
+ vertexai.init(project="gen-lang-client-0608257787", location="us-west1") # Reemplaza "your-project-id" y "your-location"
22
+
23
+ # Inicializaci贸n del modelo Gemini usando Vertex AI
24
+ model = GenerativeModel(model_name="gemini-1.0-pro-vision")
25
+
26
  # Clases para la gesti贸n de pedidos
27
  class PedidoAgent:
28
  def __init__(self, menu_csv_path):
 
182
  )
183
 
184
  # Encabezado
185
+ st.image("biblia.jpg")
186
  st.title("馃摉 LOS C脫DIGOS DE DIOS - BOTIDINAMIX AI")
187
  st.markdown("Bienvenido al Asistente Teol贸gico, donde puedes preguntar sobre interpretaciones y reflexiones b铆blicas.")
188
 
 
258
  calculo_pedido_agent.calcular_total(st.session_state)
259
 
260
  elif page == "Generador de Frases B铆blicas":
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  # Funci贸n para obtener una frase relacionada usando el modelo Gemini Advanced
262
  def obtener_frase_relacionada(versiculo):
263
  try: