geronimo-pericoli commited on
Commit
0641f61
1 Parent(s): 983db37

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -1
app.py CHANGED
@@ -1,4 +1,5 @@
1
  # Importacion de Librerias
 
2
  import os
3
  import openai
4
  from llama_index.core import SimpleDirectoryReader, ServiceContext, VectorStoreIndex
@@ -17,6 +18,27 @@ from gradio import components
17
  import textwrap
18
  import datetime
19
  from llama_index.core import Settings
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  openai.api_key = os.environ.get('openai_key')
22
  os.environ["OPENAI_API_KEY"] = os.environ.get('openai_key')
@@ -31,7 +53,7 @@ exec(os.environ.get('storage_context'))
31
 
32
  # load index
33
  prompt = """Eres el asistente virtual de la empresa Pharma.IA, responde las consultas como un experto en fabricacion de medicamentos, validacion de software e inteligencia artificial. Responder en español.
34
- Cuando no tengas la respuesta indica al usuario que consulte a info@pharma-ia.com.ar
35
  """
36
  ### Fin context ###
37
 
 
1
  # Importacion de Librerias
2
+ # Importacion de Librerias
3
  import os
4
  import openai
5
  from llama_index.core import SimpleDirectoryReader, ServiceContext, VectorStoreIndex
 
18
  import textwrap
19
  import datetime
20
  from llama_index.core import Settings
21
+ from llama_index.embeddings.openai import OpenAIEmbedding
22
+ from llama_index.core.node_parser import SentenceSplitter
23
+ from llama_index.core.tools import RetrieverTool
24
+ from llama_index.core.selectors import LLMSingleSelector, LLMMultiSelector
25
+ from llama_index.core.selectors import (
26
+ PydanticMultiSelector,
27
+ PydanticSingleSelector,
28
+ )
29
+ from llama_index.core.retrievers import (
30
+ BaseRetriever,
31
+ VectorIndexRetriever,
32
+ KGTableRetriever,
33
+ RouterRetriever
34
+ )
35
+ from llama_index.core import get_response_synthesizer
36
+ from llama_index.core.query_engine import RetrieverQueryEngine
37
+ from llama_index.core.prompts import PromptTemplate
38
+ from llama_index.core import QueryBundle
39
+ from llama_index.core.schema import NodeWithScore
40
+ from llama_index.core.postprocessor import SentenceTransformerRerank
41
+ from typing import List
42
 
43
  openai.api_key = os.environ.get('openai_key')
44
  os.environ["OPENAI_API_KEY"] = os.environ.get('openai_key')
 
53
 
54
  # load index
55
  prompt = """Eres el asistente virtual de la empresa Pharma.IA, responde las consultas como un experto en fabricacion de medicamentos, validacion de software e inteligencia artificial. Responder en español.
56
+ Cuando no tengas la respuesta indica al usuario que consulte a info@pharma-ia.com.ar. Consulta:
57
  """
58
  ### Fin context ###
59